You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Eitan Adler <li...@eitanadler.com> on 2018/08/23 12:39:04 UTC

Use of Java 8 features in the commons

On Wed, 22 Aug 2018 at 23:28, Benedikt Ritter <br...@apache.org> wrote:
>
> Hi,
>
> Am Mo., 20. Aug. 2018 um 19:09 Uhr schrieb Benedikt Ritter <
> britter@apache.org>:
>
> > Hi,
> >
> > any objections against raising the minimum required Java version for lang
> > 3.9 to Java 1.8?
> >
>
> Since there where no objections, I've created a PR for this change:
> https://github.com/apache/commons-lang/pull/346

Apologies if this was discussed in the past (and if so, please point
me at the discussion).

As the various commons libraries switch to Java 8 minimum what do
people thinking of mechanical migrations to use new languages
features. For example making of use of method references, stream API,
etc. Is this something we should only do when we're touching the
relevant code, or are wider migrations reasonable?





-- 
Eitan Adler

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


Re: Use of Java 8 features in the commons

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Aug 23, 2018 at 6:39 AM Eitan Adler <li...@eitanadler.com> wrote:

> On Wed, 22 Aug 2018 at 23:28, Benedikt Ritter <br...@apache.org> wrote:
> >
> > Hi,
> >
> > Am Mo., 20. Aug. 2018 um 19:09 Uhr schrieb Benedikt Ritter <
> > britter@apache.org>:
> >
> > > Hi,
> > >
> > > any objections against raising the minimum required Java version for
> lang
> > > 3.9 to Java 1.8?
> > >
> >
> > Since there where no objections, I've created a PR for this change:
> > https://github.com/apache/commons-lang/pull/346
>
> Apologies if this was discussed in the past (and if so, please point
> me at the discussion).
>
> As the various commons libraries switch to Java 8 minimum what do
> people thinking of mechanical migrations to use new languages
> features. For example making of use of method references, stream API,
> etc. Is this something we should only do when we're touching the
> relevant code, or are wider migrations reasonable?
>

I think that's fine as long as consequences are understood and accepted.
For example, back in Java 5, the new for each loop can introduce the
creation and use of an  iterator over a collection/array, which creates
garbage that was not there before.

Gary

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

Re: Use of Java 8 features in the commons

Posted by Stefan Bodewig <bo...@apache.org>.
On 2018-08-23, Eitan Adler wrote:

> As the various commons libraries switch to Java 8 minimum what do
> people thinking of mechanical migrations to use new languages
> features. For example making of use of method references, stream API,
> etc. Is this something we should only do when we're touching the
> relevant code, or are wider migrations reasonable?

We've had extremely bad experience with commits that switched to new
language features all over the code base. They created extremely big
commits that have been very hard to review - and introduced subtle
diferences that resulted in multiple regressions.

I'd strongly recommend to only change code you are touching anyway.

If you really feel like doing changes accross the code base please make
sure you do so in commits that are of a reasonable size and can be
reviewed easily.

Stefan


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


Re: Use of Java 8 features in the commons

Posted by Benedikt Ritter <br...@apache.org>.
Hi Eitan,

Am Do., 23. Aug. 2018 um 14:39 Uhr schrieb Eitan Adler <lists@eitanadler.com
>:

> On Wed, 22 Aug 2018 at 23:28, Benedikt Ritter <br...@apache.org> wrote:
> >
> > Hi,
> >
> > Am Mo., 20. Aug. 2018 um 19:09 Uhr schrieb Benedikt Ritter <
> > britter@apache.org>:
> >
> > > Hi,
> > >
> > > any objections against raising the minimum required Java version for
> lang
> > > 3.9 to Java 1.8?
> > >
> >
> > Since there where no objections, I've created a PR for this change:
> > https://github.com/apache/commons-lang/pull/346
>
> Apologies if this was discussed in the past (and if so, please point
> me at the discussion).
>
> As the various commons libraries switch to Java 8 minimum what do
> people thinking of mechanical migrations to use new languages
> features. For example making of use of method references, stream API,
> etc. Is this something we should only do when we're touching the
> relevant code, or are wider migrations reasonable?
>

Yes we should use the new features available to improve implementation of
our code base. I'm not a friend of automatic migration. I think it's better
do this by hand. Otherwise you might have undesired results.

Benedikt


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