You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Gary Gregory <ga...@gmail.com> on 2020/01/19 14:03:49 UTC

[proposal] Upcoming version 5 should require Java 8, not 7

I propose that the upcoming HttpCore and HttpClient version 5.0 should
require Java 8, not 7.

- This will allow us to use java.time.Duration instead of cooking up our
own TimeValue. Even if we want to keep the TimeValue and Timeout
abstraction, they can implemented using a java.time.Duration.
- This will allow us to use java.util.function instead of cooking up our
own org.apache.hc.core5.function
- This will avoid all sorts of ugly if and when we do adopt Java 8 within
5.x as surely we should offer Duration APIs where we now use TimeValue.
Same for org.apache.hc.core5.function.
- This will allow us to use lambdas where appropriate.
- Java 7 is deader than a doornail and is a barrier to entry for
contributors used to more modern Java versions.

Thoughts?

Gary

Re: [proposal] Upcoming version 5 should require Java 8, not 7

Posted by Michael Osipov <mi...@apache.org>.
Am 2020-01-20 um 19:29 schrieb Ryan Schmitt:
> The right time to upgrade to JDK8 would have been three years ago, before
> reams of callback code got written, and everything could have been built
> around CompletableFuture from the ground up. At this point, switching would
> be the worst of both worlds: we'd have a JDK7-style codebase without JDK7
> compatibility. (I'm told some people still like JDK7. Android developers, I
> guess?) Additionally, it would further delay the GA release with additional
> months of refactoring and language-level upgrades.

Mostly agree here.

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


Re: [proposal] Upcoming version 5 should require Java 8, not 7

Posted by Gary Gregory <ga...@gmail.com>.
On Mon, Jan 20, 2020 at 1:29 PM Ryan Schmitt <rs...@apache.org> wrote:

> The right time to upgrade to JDK8 would have been three years ago, before
> reams of callback code got written, and everything could have been built
> around CompletableFuture from the ground up. At this point, switching would
> be the worst of both worlds: we'd have a JDK7-style codebase without JDK7
> compatibility. (I'm told some people still like JDK7. Android developers, I
> guess?) Additionally, it would further delay the GA release with additional
> months of refactoring and language-level upgrades.
>

The Android concern might be valid, but it's not for me ATM. Aside from
that, I think it is OK for public facing APIs to be Java 8 while internals
might still be Java 7. This distinction is likely useless since reworking
the API a la Java 8 I am sure would be best done soup to nuts. The worst of
both worlds for me would be to release 5.0 on Java 7, then, as proposed
earlier, 5.1 on Java 8. You'd then end up with an obsolete looking API by
design. I might be reading our crowd incorrectly, but I do not see the
appetite around here for thinking about a Java 8 based 6.0 to eliminate our
"let's pretend we're on Java 8" util code. How do you see it?

Gary


>
> The only argument for upgrading to JDK8 that gives me pause is that we
> would have access to default interface methods. I don't think long-term
> library evolution is feasible without them, and I believe this is why the
> Log4j2 API is being upgraded to JDK8 in the 2.13 release.
>
> On Sun, Jan 19, 2020 at 6:04 AM Gary Gregory <ga...@gmail.com>
> wrote:
>
> > I propose that the upcoming HttpCore and HttpClient version 5.0 should
> > require Java 8, not 7.
> >
> > - This will allow us to use java.time.Duration instead of cooking up our
> > own TimeValue. Even if we want to keep the TimeValue and Timeout
> > abstraction, they can implemented using a java.time.Duration.
> > - This will allow us to use java.util.function instead of cooking up our
> > own org.apache.hc.core5.function
> > - This will avoid all sorts of ugly if and when we do adopt Java 8 within
> > 5.x as surely we should offer Duration APIs where we now use TimeValue.
> > Same for org.apache.hc.core5.function.
> > - This will allow us to use lambdas where appropriate.
> > - Java 7 is deader than a doornail and is a barrier to entry for
> > contributors used to more modern Java versions.
> >
> > Thoughts?
> >
> > Gary
> >
>

Re: [proposal] Upcoming version 5 should require Java 8, not 7

Posted by Ryan Schmitt <rs...@apache.org>.
The right time to upgrade to JDK8 would have been three years ago, before
reams of callback code got written, and everything could have been built
around CompletableFuture from the ground up. At this point, switching would
be the worst of both worlds: we'd have a JDK7-style codebase without JDK7
compatibility. (I'm told some people still like JDK7. Android developers, I
guess?) Additionally, it would further delay the GA release with additional
months of refactoring and language-level upgrades.

The only argument for upgrading to JDK8 that gives me pause is that we
would have access to default interface methods. I don't think long-term
library evolution is feasible without them, and I believe this is why the
Log4j2 API is being upgraded to JDK8 in the 2.13 release.

On Sun, Jan 19, 2020 at 6:04 AM Gary Gregory <ga...@gmail.com> wrote:

> I propose that the upcoming HttpCore and HttpClient version 5.0 should
> require Java 8, not 7.
>
> - This will allow us to use java.time.Duration instead of cooking up our
> own TimeValue. Even if we want to keep the TimeValue and Timeout
> abstraction, they can implemented using a java.time.Duration.
> - This will allow us to use java.util.function instead of cooking up our
> own org.apache.hc.core5.function
> - This will avoid all sorts of ugly if and when we do adopt Java 8 within
> 5.x as surely we should offer Duration APIs where we now use TimeValue.
> Same for org.apache.hc.core5.function.
> - This will allow us to use lambdas where appropriate.
> - Java 7 is deader than a doornail and is a barrier to entry for
> contributors used to more modern Java versions.
>
> Thoughts?
>
> Gary
>

Re: [proposal] Upcoming version 5 should require Java 8, not 7

Posted by Ryan Schmitt <rs...@apache.org>.
I don't even think we should plan on starting a Java 8 release this spring.
We still have a lot of bug-fixing and stabilization work ahead of us, and
dealing with active development on 5.0 and 5.1/6.0 side-by-side is going to
be a significant distraction. Additionally, the need to easily cherry-pick
patches or git-merge one version into another will prevent us from making
disruptive changes in the JDK8 code base, and here "disruptive" includes
basic stuff like migrating to lambda syntax.

I would be more interested in seeing whether we can build a separate JDK8
module for 5.0 that adds CompletableFuture<T> interoperability. If such a
thing is possible, I think it will scratch the same itch without the
destabilizing effects on the codebase and development workflow. We've
already done similar things in the form of :httpcore5-reactive, and of
HttpAsyncClient on the 4.x line.

On Tue, Jan 21, 2020 at 2:18 PM Michael Osipov <mi...@apache.org> wrote:

> Am 2020-01-19 um 15:03 schrieb Gary Gregory:
> > I propose that the upcoming HttpCore and HttpClient version 5.0 should
> > require Java 8, not 7.
> >
> > - This will allow us to use java.time.Duration instead of cooking up our
> > own TimeValue. Even if we want to keep the TimeValue and Timeout
> > abstraction, they can implemented using a java.time.Duration.
> > - This will allow us to use java.util.function instead of cooking up our
> > own org.apache.hc.core5.function
> > - This will avoid all sorts of ugly if and when we do adopt Java 8 within
> > 5.x as surely we should offer Duration APIs where we now use TimeValue.
> > Same for org.apache.hc.core5.function.
> > - This will allow us to use lambdas where appropriate.
>
> I am not totally against this, but do you really think that
> stop-the-world and rewrite a lot of code for the sake of Java 8 will
> help us? Will will throw us at least three months or more back.
>
> I would really get back to my proposal at GH: Move on with 5.0, keep it
> for a year or so and start working on 6.0 in Spring with Java 8.
>
> Since we have learned what we can do better in the future, let's keep it
> for the future.
>
> > - Java 7 is deader than a doornail and is a barrier to entry for
> > contributors used to more modern Java versions.
>
> We have worse problem than sticking to Java 7, imho.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Re: [proposal] Upcoming version 5 should require Java 8, not 7

Posted by Gary Gregory <ga...@gmail.com>.
On Tue, Jan 21, 2020 at 5:18 PM Michael Osipov <mi...@apache.org> wrote:

> Am 2020-01-19 um 15:03 schrieb Gary Gregory:
> > I propose that the upcoming HttpCore and HttpClient version 5.0 should
> > require Java 8, not 7.
> >
> > - This will allow us to use java.time.Duration instead of cooking up our
> > own TimeValue. Even if we want to keep the TimeValue and Timeout
> > abstraction, they can implemented using a java.time.Duration.
> > - This will allow us to use java.util.function instead of cooking up our
> > own org.apache.hc.core5.function
> > - This will avoid all sorts of ugly if and when we do adopt Java 8 within
> > 5.x as surely we should offer Duration APIs where we now use TimeValue.
> > Same for org.apache.hc.core5.function.
> > - This will allow us to use lambdas where appropriate.
>
> I am not totally against this, but do you really think that
> stop-the-world and rewrite a lot of code for the sake of Java 8 will
> help us? Will will throw us at least three months or more back.
>
> I would really get back to my proposal at GH: Move on with 5.0, keep it
> for a year or so and start working on 6.0 in Spring with Java 8.
>

I am fine with a 6.0 on Java 8 sooner rather than later but it is *not *what
was suggested earlier (5.1 on Java 8 which would be ugly IMO.)

Gary


> Since we have learned what we can do better in the future, let's keep it
> for the future.
>
> > - Java 7 is deader than a doornail and is a barrier to entry for
> > contributors used to more modern Java versions.
>
> We have worse problem than sticking to Java 7, imho.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Re: [proposal] Upcoming version 5 should require Java 8, not 7

Posted by Michael Osipov <mi...@apache.org>.
Am 2020-01-19 um 15:03 schrieb Gary Gregory:
> I propose that the upcoming HttpCore and HttpClient version 5.0 should
> require Java 8, not 7.
> 
> - This will allow us to use java.time.Duration instead of cooking up our
> own TimeValue. Even if we want to keep the TimeValue and Timeout
> abstraction, they can implemented using a java.time.Duration.
> - This will allow us to use java.util.function instead of cooking up our
> own org.apache.hc.core5.function
> - This will avoid all sorts of ugly if and when we do adopt Java 8 within
> 5.x as surely we should offer Duration APIs where we now use TimeValue.
> Same for org.apache.hc.core5.function.
> - This will allow us to use lambdas where appropriate.

I am not totally against this, but do you really think that 
stop-the-world and rewrite a lot of code for the sake of Java 8 will 
help us? Will will throw us at least three months or more back.

I would really get back to my proposal at GH: Move on with 5.0, keep it 
for a year or so and start working on 6.0 in Spring with Java 8.

Since we have learned what we can do better in the future, let's keep it 
for the future.

> - Java 7 is deader than a doornail and is a barrier to entry for
> contributors used to more modern Java versions.

We have worse problem than sticking to Java 7, imho.

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