Timeline for upgrading `jackson-databind` to require Java 8

42 views
Skip to first unread message

Tatu Saloranta

unread,
Nov 21, 2019, 1:31:27 PM11/21/19
to jacks...@googlegroups.com, jackson-user
Ok, time to bring this up again.

So. Currently jackson-databind 2.10 may be run on JDK 7 (*). Other
components differ in that jackson-annotations and jackson-core run on
JDK 6, and some modules need JDK8 (Java 8 obviously, but some
dataformats have deps that need Java 8 as well).

Jackson 3.0 (master) requires JDK 8 already; but since it is in
development, target JDK can be re-considered at some point.

But. Would it make sense to upgrade baseline JDK 8 requirement for
`jackson-databind`? Doing this would mostly matter (IMO) in that doing
that would allow use of closures (method pointers) for API /
configuration. There would be some other smaller benefits, like
directly including `Optional` support, constructor name parameter
access.

If we were to move the baseline, this could happen as early as 2.11
(probably due in Jan 2020), or if not, following that in 2.12.
Whatever version predating this version would also become "long-term
supported" Jackson version, i.e. be patched longer than usual, to
support use cases where going Java 8 is not possible

But first I would like to know of users, if any, that use Jackson on
pre-Java8 platforms (or platforms where full JDK 8 based version would
not work).

So: concerns, comments, suggestions?

-+ Tatu +-

(*) there are occasionally reported issues wrt whether it truly works
on some of sorta-J2SE platforms, like Android, but aside from those

Marshall Pierce

unread,
Nov 21, 2019, 1:53:08 PM11/21/19
to jackson-user
I think anyone who's current enough to be on recent Jackson is going to
be on at least Java 8. I see pretty widespread Java 8 minimums on
libraries these days, so I think 2.11 is fine as long as you're OK with
2.10 being the LTS one.

That said, I'm mercifully not working in Android for a long time so I
don't know what their situation is; maybe everyone just uses org.json
there ;)

Michael Rogers

unread,
Dec 4, 2019, 5:36:36 AM12/4/19
to jackso...@googlegroups.com, Marshall Pierce
The situation on Android is that unfortunately we still need to maintain
compatibility with the Java 6 API to support Android 6 and older (about
half of currently active devices). Java 8 language features are OK - the
Android toolchain transforms them into Java 6-compatible bytecode.

So from my point of view it would be nice if a supported version of
Jackson was compatible with the Java 6 API for a few more years.

Animal Sniffer can be used to check API compatibility at build time.

Cheers,
Michael
0x11044FD19FC527CC.asc
signature.asc

Tatu Saloranta

unread,
Dec 4, 2019, 7:45:27 PM12/4/19
to jackson-user, Marshall Pierce
On Wed, Dec 4, 2019 at 2:36 AM Michael Rogers <mic...@briarproject.org> wrote:
>
> The situation on Android is that unfortunately we still need to maintain
> compatibility with the Java 6 API to support Android 6 and older (about
> half of currently active devices). Java 8 language features are OK - the
> Android toolchain transforms them into Java 6-compatible bytecode.
>
> So from my point of view it would be nice if a supported version of
> Jackson was compatible with the Java 6 API for a few more years.
>
> Animal Sniffer can be used to check API compatibility at build time.

Interesting.

One thing that I am missing, unfortunately, is a regression test suite
that could detect cases where post-JDK6 API was being used. It would
be great if there was a profile for Travis (for example), to test this
out. I do get bug reports for regressions, but those are
after-the-fact (i.e. when a version has broken compatibility).

-+ Tatu +-
> --
> You received this message because you are subscribed to the Google Groups "jackson-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jackson-user/60029ccb-fc02-0ded-a15d-351462ffb133%40briarproject.org.

Michael Rogers

unread,
Dec 5, 2019, 5:17:20 AM12/5/19
to jackso...@googlegroups.com, Tatu Saloranta, Marshall Pierce
On 05/12/2019 00:45, Tatu Saloranta wrote:
> On Wed, Dec 4, 2019 at 2:36 AM Michael Rogers <mic...@briarproject.org> wrote:
>>
>> The situation on Android is that unfortunately we still need to maintain
>> compatibility with the Java 6 API to support Android 6 and older (about
>> half of currently active devices). Java 8 language features are OK - the
>> Android toolchain transforms them into Java 6-compatible bytecode.
>>
>> So from my point of view it would be nice if a supported version of
>> Jackson was compatible with the Java 6 API for a few more years.
>>
>> Animal Sniffer can be used to check API compatibility at build time.
>
> Interesting.
>
> One thing that I am missing, unfortunately, is a regression test suite
> that could detect cases where post-JDK6 API was being used. It would
> be great if there was a profile for Travis (for example), to test this
> out. I do get bug reports for regressions, but those are
> after-the-fact (i.e. when a version has broken compatibility).

I've only used the Gradle plugin myself, but Animal Sniffer also has a
Maven plugin that could perhaps be incorporated into the Travis build?

For what it's worth, here's an example of using the Gradle plugin. The
'sourceCompatibility' line indicates that we can use Java 8 language
features. The 'targetCompatibility' line is misleading; it has to be set
to the same value as 'sourceCompatibility', but we're actually
targetting the Java 6 API. The 'signature' line tells the Animal Sniffer
plugin to check for compatibility with the Java 6 API:

https://code.briarproject.org/briar/briar/blob/master/bramble-api/build.gradle

Cheers,
Michael
0x11044FD19FC527CC.asc
signature.asc

Tatu Saloranta

unread,
Dec 11, 2019, 1:36:32 AM12/11/19
to Michael Rogers, jackson-user, Marshall Pierce
Thank you, this could be useful to try out if I find time, or anyone
else could try it out.
Reply all
Reply to author
Forward
0 new messages