ConfigMe icon indicating copy to clipboard operation
ConfigMe copied to clipboard

Switch to Java 11

Open ljacqu opened this issue 2 years ago • 1 comments

Not planning to switch soon, but to keep some improvements/adjustments that we could make after switching:

  • See comments in code referencing this issue
  • Use List.of and Set.of where appropriate instead of more verbose Arrays.asList, etc.
  • !Optional.isPresent = Optional.isEmpty
  • collect(toList()) -> Stream#toList
  • Upgrade to Mockito 5
  • Remove Mockito exclusion from dependabot.yml
  • Handling records requires a lot of reflection acrobatics at the moment

Note

You might see this issue referenced a lot in the code base also for later Java versions. This issue number is used as a general bookmark to note Java differences. If we switch to Java 11, we'll probably change the comments to reference another issue.

ljacqu avatar Aug 10 '23 20:08 ljacqu

Hi, updating to Java 11 just to use these methods doesn't make much sense. Additionally, compatibility with Java 8 is more important in my opinion, as there are older projects that require the use of this JDK version.

However, if there is a way to create a second Jar file that is compatible with Java 8, as they do, for example, with HSQLDB, then you can proceed with the modification.

<dependency>
    <groupId>org.hsqldb</groupId>
    <artifactId>hsqldb</artifactId>
    <version>2.7.1</version>
    <classifier>jdk8</classifier>
    <type>jar</type>
</dependency>

Thank you.

gamerover98 avatar Oct 27 '23 07:10 gamerover98