Maybe we could write a preprocessor with macros so that we could automagically insert different code for different java versions!
(in case you didn't notice, this is a joke suggestion) On Mon, Apr 27, 2020 at 10:16 AM Enrico Olivelli <eolive...@gmail.com> wrote: > Optional 2 is the best. > > I have fallen into this problem while preparing 3.6.1 rc. I was using jdk14 > and my binaries wouldn't run in jdk8 > > Enrico > > Il Lun 27 Apr 2020, 18:58 Andor Molnar <an...@apache.org> ha scritto: > > > Hi folks, > > > > https://issues.apache.org/jira/browse/ZOOKEEPER-3215 > > > > has come up recently again and I’m thinking of the right way to resolve > > this. Given that we have some Maven experts in the house my first > question > > would be: can we just resolve this with some Maven magic? > > > > Option #1 > > Apply https://github.com/apache/zookeeper/pull/760 on master branch to > > make explicit casts which will hint the compiler to use the right method. > > > > Option #2 > > Detect the Java compiler with Maven and add “—release 8” switch to all > > Java compilers with version 9+. > > > > I really want to resolve this with some automated solution, because > > changing the source code seems to me ugly and fragile. Do we have any > other > > option? > > > > Regards, > > Andor > > > > > > >