You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Isira Seneviratne <is...@gmail.com> on 2020/05/10 09:57:56 UTC

Re: [LANG] Porting to Kotlin

Since the original attachments did not come through, I've created a
temporary GitHub repository for the proposed library, for anyone who is
interested: https://github.com/Isira-Seneviratne/commons-lang-kt.git

--
Isira Seneviratne
isirasen96@gmail.com

Re: [LANG] Porting to Kotlin

Posted by Isira Seneviratne <is...@gmail.com>.
On Sun, May 10, 2020, 8:18 PM Xeno Amess <xe...@gmail.com> wrote:

> Hi.
> If you mean this then I will be a +1 instead.
> Just, do not convert anything original java code to kotlin, and make sure
> pure java user will not be affected.
>

That shouldn't be necessary.

And I don't really mind if you add some kotlin util class dealing with
> kotlin things.
>
>
> Isira Seneviratne <is...@gmail.com> 于2020年5月10日周日 下午9:33写道:
>
> > On Sun, May 10, 2020, 6:55 PM Gilles Sadowski <gi...@gmail.com>
> > wrote:
> >
> > > Hi.
> > >
> > > In what consists the "porting"?  Could you give an example?
> > >
> >
> > Of course.
> >
> > Extension functions and properties are a language feature of Kotlin,
> which
> > allow a function/property to be called from a variable as if it was part
> of
> > the original class declaration:
> > https://kotlinlang.org/docs/reference/extensions.html
> >
> >
> > > If it's straightforward and can be automated, it might be worth
> > > creating the port for all the Commons components (as part of
> > > the release) in a move that can potentially expand our team of
> > > developers (if Kotlin programmers are willing to participate to
> > > the "upstream" Java project, of course).
> > >
> > > Regards,
> > > Gilles
> > >
> > > >> [...]
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > > For additional commands, e-mail: dev-help@commons.apache.org
> > >
> > >
> >
>

Re: [LANG] Porting to Kotlin

Posted by Xeno Amess <xe...@gmail.com>.
Hi.
If you mean this then I will be a +1 instead.
Just, do not convert anything original java code to kotlin, and make sure
pure java user will not be affected.
And I don't really mind if you add some kotlin util class dealing with
kotlin things.


Isira Seneviratne <is...@gmail.com> 于2020年5月10日周日 下午9:33写道:

> On Sun, May 10, 2020, 6:55 PM Gilles Sadowski <gi...@gmail.com>
> wrote:
>
> > Hi.
> >
> > In what consists the "porting"?  Could you give an example?
> >
>
> Of course.
>
> Extension functions and properties are a language feature of Kotlin, which
> allow a function/property to be called from a variable as if it was part of
> the original class declaration:
> https://kotlinlang.org/docs/reference/extensions.html
>
>
> > If it's straightforward and can be automated, it might be worth
> > creating the port for all the Commons components (as part of
> > the release) in a move that can potentially expand our team of
> > developers (if Kotlin programmers are willing to participate to
> > the "upstream" Java project, of course).
> >
> > Regards,
> > Gilles
> >
> > >> [...]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
>

Re: [LANG] Porting to Kotlin

Posted by Matt Sicker <bo...@gmail.com>.
This sounds similar to our Log4j Kotlin API. It’s an adapter library to
integrate with Kotlin-specific features or APIs (they provide a mini
standard library on top of Java like how Groovy does).

On Sun, May 10, 2020 at 09:54 Gilles Sadowski <gi...@gmail.com> wrote:

> Hi.
>
> Le dim. 10 mai 2020 à 15:34, Isira Seneviratne <is...@gmail.com> a
> écrit :
> >
> > I hope my answer was helpful. If you need any more information, please
> let
> > me know.
>
> Please explain, by example, how we would go in order to provide a Kotlin
> release?
> IIUC, your PR does not cover all of [Lang] (?).
> Might be worth posting in a new thread (with the "[ALL]" prefix).
>
> Thanks,
> Gilles
>
>
> > On Sun, May 10, 2020, 7:03 PM Isira Seneviratne <is...@gmail.com>
> > wrote:
> >
> > >
> > >
> > > On Sun, May 10, 2020, 6:55 PM Gilles Sadowski <gi...@gmail.com>
> > > wrote:
> > >
> > >> Hi.
> > >>
> > >> In what consists the "porting"?  Could you give an example?
> > >>
> > >
> > > Of course.
> > >
> > > Extension functions and properties are a language feature of Kotlin,
> which
> > > allow a function/property to be called from a variable as if it was
> part of
> > > the original class declaration:
> > > https://kotlinlang.org/docs/reference/extensions.html
> > >
> > >
> > >> If it's straightforward and can be automated, it might be worth
> > >> creating the port for all the Commons components (as part of
> > >> the release) in a move that can potentially expand our team of
> > >> developers (if Kotlin programmers are willing to participate to
> > >> the "upstream" Java project, of course).
> > >>
> > >> Regards,
> > >> Gilles
> > >>
> > >> >> [...]
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > >> For additional commands, e-mail: dev-help@commons.apache.org
> > >>
> > >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
> --
Matt Sicker <bo...@gmail.com>

Re: [LANG] Porting to Kotlin

Posted by Isira Seneviratne <is...@gmail.com>.
On Mon, May 11, 2020, 1:20 PM Gilles Sadowski <gi...@gmail.com> wrote:

> 2020-05-11 1:01 UTC+02:00, Isira Seneviratne <is...@gmail.com>:
> > On Sun, May 10, 2020 at 8:24 PM Gilles Sadowski <gi...@gmail.com>
> > wrote:
> >
> >> Hi.
> >>
> >> Le dim. 10 mai 2020 à 15:34, Isira Seneviratne <is...@gmail.com> a
> >> écrit :
> >> >
> >> > I hope my answer was helpful. If you need any more information, please
> >> let
> >> > me know.
> >>
> >> Please explain, by example, how we would go in order to provide a Kotlin
> >> release?
> >>
> >
> > Sorry for the late reply. I was asleep.
>
> It's necessary sometimes. ;-)
>
> > I was thinking of adding extension functions that map to the methods
> > provided in the Utils classes (however, some methods, such as
> StringUtils'
> > isNotEmpty(), do not need to be mapped as there are similar functions in
> > the Kotlin standard library).
> >
> >
> >> IIUC, your PR does not cover all of [Lang] (?).
> >>
> >
> > Yeah, I was only thinking of covering the Utils classes (unless anyone
> has
> > any other suggestions as well?)
>
> Yes, see below.
>
> >> Might be worth posting in a new thread (with the "[ALL]" prefix).
> >>
> >
> > Why is that?
>
> Because of what I suggested (quoted below); there is more than
> [Lang] in Commons.[1]
>

Ah, right.

Yeah, the various Utils classes in other Commons libraries could be ported
as well.

Thanks!


> >> > > [...]
> >> > >
> >> > >> If it's straightforward and can be automated, it might be worth
> >> > >> creating the port for all the Commons components (as part of
> >> > >> the release) in a move that can potentially expand our team of
> >> > >> developers (if Kotlin programmers are willing to participate to
> >> > >> the "upstream" Java project, of course).
>
> Regards,
> Gilles
>
> [1] http://commons.apache.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: [LANG] Porting to Kotlin

Posted by Gilles Sadowski <gi...@gmail.com>.
2020-05-11 1:01 UTC+02:00, Isira Seneviratne <is...@gmail.com>:
> On Sun, May 10, 2020 at 8:24 PM Gilles Sadowski <gi...@gmail.com>
> wrote:
>
>> Hi.
>>
>> Le dim. 10 mai 2020 à 15:34, Isira Seneviratne <is...@gmail.com> a
>> écrit :
>> >
>> > I hope my answer was helpful. If you need any more information, please
>> let
>> > me know.
>>
>> Please explain, by example, how we would go in order to provide a Kotlin
>> release?
>>
>
> Sorry for the late reply. I was asleep.

It's necessary sometimes. ;-)

> I was thinking of adding extension functions that map to the methods
> provided in the Utils classes (however, some methods, such as StringUtils'
> isNotEmpty(), do not need to be mapped as there are similar functions in
> the Kotlin standard library).
>
>
>> IIUC, your PR does not cover all of [Lang] (?).
>>
>
> Yeah, I was only thinking of covering the Utils classes (unless anyone has
> any other suggestions as well?)

Yes, see below.

>> Might be worth posting in a new thread (with the "[ALL]" prefix).
>>
>
> Why is that?

Because of what I suggested (quoted below); there is more than
[Lang] in Commons.[1]

>> > > [...]
>> > >
>> > >> If it's straightforward and can be automated, it might be worth
>> > >> creating the port for all the Commons components (as part of
>> > >> the release) in a move that can potentially expand our team of
>> > >> developers (if Kotlin programmers are willing to participate to
>> > >> the "upstream" Java project, of course).

Regards,
Gilles

[1] http://commons.apache.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [LANG] Porting to Kotlin

Posted by Isira Seneviratne <is...@gmail.com>.
On Sun, May 10, 2020 at 8:24 PM Gilles Sadowski <gi...@gmail.com>
wrote:

> Hi.
>
> Le dim. 10 mai 2020 à 15:34, Isira Seneviratne <is...@gmail.com> a
> écrit :
> >
> > I hope my answer was helpful. If you need any more information, please
> let
> > me know.
>
> Please explain, by example, how we would go in order to provide a Kotlin
> release?
>

Sorry for the late reply. I was asleep.

I was thinking of adding extension functions that map to the methods
provided in the Utils classes (however, some methods, such as StringUtils'
isNotEmpty(), do not need to be mapped as there are similar functions in
the Kotlin standard library).


> IIUC, your PR does not cover all of [Lang] (?).
>

Yeah, I was only thinking of covering the Utils classes (unless anyone has
any other suggestions as well?)


> Might be worth posting in a new thread (with the "[ALL]" prefix).
>

Why is that?


>
> Thanks,
> Gilles
>
>
> > On Sun, May 10, 2020, 7:03 PM Isira Seneviratne <is...@gmail.com>
> > wrote:
> >
> > >
> > >
> > > On Sun, May 10, 2020, 6:55 PM Gilles Sadowski <gi...@gmail.com>
> > > wrote:
> > >
> > >> Hi.
> > >>
> > >> In what consists the "porting"?  Could you give an example?
> > >>
> > >
> > > Of course.
> > >
> > > Extension functions and properties are a language feature of Kotlin,
> which
> > > allow a function/property to be called from a variable as if it was
> part of
> > > the original class declaration:
> > > https://kotlinlang.org/docs/reference/extensions.html
> > >
> > >
> > >> If it's straightforward and can be automated, it might be worth
> > >> creating the port for all the Commons components (as part of
> > >> the release) in a move that can potentially expand our team of
> > >> developers (if Kotlin programmers are willing to participate to
> > >> the "upstream" Java project, of course).
> > >>
> > >> Regards,
> > >> Gilles
> > >>
> > >> >> [...]
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > >> For additional commands, e-mail: dev-help@commons.apache.org
> > >>
> > >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: [LANG] Porting to Kotlin

Posted by Gilles Sadowski <gi...@gmail.com>.
Hi.

Le dim. 10 mai 2020 à 15:34, Isira Seneviratne <is...@gmail.com> a écrit :
>
> I hope my answer was helpful. If you need any more information, please let
> me know.

Please explain, by example, how we would go in order to provide a Kotlin
release?
IIUC, your PR does not cover all of [Lang] (?).
Might be worth posting in a new thread (with the "[ALL]" prefix).

Thanks,
Gilles


> On Sun, May 10, 2020, 7:03 PM Isira Seneviratne <is...@gmail.com>
> wrote:
>
> >
> >
> > On Sun, May 10, 2020, 6:55 PM Gilles Sadowski <gi...@gmail.com>
> > wrote:
> >
> >> Hi.
> >>
> >> In what consists the "porting"?  Could you give an example?
> >>
> >
> > Of course.
> >
> > Extension functions and properties are a language feature of Kotlin, which
> > allow a function/property to be called from a variable as if it was part of
> > the original class declaration:
> > https://kotlinlang.org/docs/reference/extensions.html
> >
> >
> >> If it's straightforward and can be automated, it might be worth
> >> creating the port for all the Commons components (as part of
> >> the release) in a move that can potentially expand our team of
> >> developers (if Kotlin programmers are willing to participate to
> >> the "upstream" Java project, of course).
> >>
> >> Regards,
> >> Gilles
> >>
> >> >> [...]
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: dev-help@commons.apache.org
> >>
> >>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [LANG] Porting to Kotlin

Posted by Isira Seneviratne <is...@gmail.com>.
I hope my answer was helpful. If you need any more information, please let
me know.

On Sun, May 10, 2020, 7:03 PM Isira Seneviratne <is...@gmail.com>
wrote:

>
>
> On Sun, May 10, 2020, 6:55 PM Gilles Sadowski <gi...@gmail.com>
> wrote:
>
>> Hi.
>>
>> In what consists the "porting"?  Could you give an example?
>>
>
> Of course.
>
> Extension functions and properties are a language feature of Kotlin, which
> allow a function/property to be called from a variable as if it was part of
> the original class declaration:
> https://kotlinlang.org/docs/reference/extensions.html
>
>
>> If it's straightforward and can be automated, it might be worth
>> creating the port for all the Commons components (as part of
>> the release) in a move that can potentially expand our team of
>> developers (if Kotlin programmers are willing to participate to
>> the "upstream" Java project, of course).
>>
>> Regards,
>> Gilles
>>
>> >> [...]
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>

Re: [LANG] Porting to Kotlin

Posted by Isira Seneviratne <is...@gmail.com>.
On Sun, May 10, 2020, 6:55 PM Gilles Sadowski <gi...@gmail.com> wrote:

> Hi.
>
> In what consists the "porting"?  Could you give an example?
>

Of course.

Extension functions and properties are a language feature of Kotlin, which
allow a function/property to be called from a variable as if it was part of
the original class declaration:
https://kotlinlang.org/docs/reference/extensions.html


> If it's straightforward and can be automated, it might be worth
> creating the port for all the Commons components (as part of
> the release) in a move that can potentially expand our team of
> developers (if Kotlin programmers are willing to participate to
> the "upstream" Java project, of course).
>
> Regards,
> Gilles
>
> >> [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: [LANG] Porting to Kotlin

Posted by Gilles Sadowski <gi...@gmail.com>.
Hi.

In what consists the "porting"?  Could you give an example?

If it's straightforward and can be automated, it might be worth
creating the port for all the Commons components (as part of
the release) in a move that can potentially expand our team of
developers (if Kotlin programmers are willing to participate to
the "upstream" Java project, of course).

Regards,
Gilles

>> [...]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [LANG] Porting to Kotlin

Posted by Isira Seneviratne <is...@gmail.com>.
I've updated all the methods to call Apache Commons Lang methods.

On Sun, May 10, 2020, 4:25 PM Isira Seneviratne <is...@gmail.com>
wrote:

>
>
> On Sun, May 10, 2020, 4:02 PM Paul King <pa...@gmail.com> wrote:
>
>> There are a number of approaches you could take. Why not just a whole
>> bunch
>> of methods that map directly to existing functionality, e.g.:
>>
>> fun Boolean?.isNotTrue() = BooleanUtils.isNotTrue(this)
>> fun Boolean.toStringYesNo() = BooleanUtils.toStringYesNo(this)
>>
>> It might be possible to automate and when making changes/fixing bugs,
>> there
>> wouldn't be two places to change. Just a thought?
>>
>
> Oh, sure.
>
>
>> Cheers, Paul.
>>
>>
>> On Sun, May 10, 2020 at 7:58 PM Isira Seneviratne <is...@gmail.com>
>> wrote:
>>
>> > Since the original attachments did not come through, I've created a
>> > temporary GitHub repository for the proposed library, for anyone who is
>> > interested: https://github.com/Isira-Seneviratne/commons-lang-kt.git
>> >
>> > --
>> > Isira Seneviratne
>> > isirasen96@gmail.com
>> >
>>
>

Re: [LANG] Porting to Kotlin

Posted by Isira Seneviratne <is...@gmail.com>.
On Sun, May 10, 2020, 4:02 PM Paul King <pa...@gmail.com> wrote:

> There are a number of approaches you could take. Why not just a whole bunch
> of methods that map directly to existing functionality, e.g.:
>
> fun Boolean?.isNotTrue() = BooleanUtils.isNotTrue(this)
> fun Boolean.toStringYesNo() = BooleanUtils.toStringYesNo(this)
>
> It might be possible to automate and when making changes/fixing bugs, there
> wouldn't be two places to change. Just a thought?
>

Oh, sure.


> Cheers, Paul.
>
>
> On Sun, May 10, 2020 at 7:58 PM Isira Seneviratne <is...@gmail.com>
> wrote:
>
> > Since the original attachments did not come through, I've created a
> > temporary GitHub repository for the proposed library, for anyone who is
> > interested: https://github.com/Isira-Seneviratne/commons-lang-kt.git
> >
> > --
> > Isira Seneviratne
> > isirasen96@gmail.com
> >
>

Re: [LANG] Porting to Kotlin

Posted by Paul King <pa...@gmail.com>.
There are a number of approaches you could take. Why not just a whole bunch
of methods that map directly to existing functionality, e.g.:

fun Boolean?.isNotTrue() = BooleanUtils.isNotTrue(this)
fun Boolean.toStringYesNo() = BooleanUtils.toStringYesNo(this)

It might be possible to automate and when making changes/fixing bugs, there
wouldn't be two places to change. Just a thought?

Cheers, Paul.


On Sun, May 10, 2020 at 7:58 PM Isira Seneviratne <is...@gmail.com>
wrote:

> Since the original attachments did not come through, I've created a
> temporary GitHub repository for the proposed library, for anyone who is
> interested: https://github.com/Isira-Seneviratne/commons-lang-kt.git
>
> --
> Isira Seneviratne
> isirasen96@gmail.com
>