SpineEventEngine / gcloud-java

Support for Spine-based Java apps running under Google Cloud
https://spine.io
Apache License 2.0
3 stars 0 forks source link

Migrate to JDK 11 and Java 11 syntax #169

Closed armiol closed 2 years ago

armiol commented 2 years ago

This changeset migrates the project to JDK 11.

In particular, the changes were made to both build scripts and the source code.

Java 11 Target

Compilation target is now set to Java 11 for both the project source code and buildSrc.

Please note that the Kotlin sources in the buildSrc are still compiled to Java 8. This is because of the compiler shipped along with the kotlin-dsl plugin, which isn't capable of configuring the compilation target. See the corresponding issue in Kotlin, which has been already addressed in 1.6.0 — but not in Gradle's kotlin-dsl.

var

Implicit var syntax is now used instead of explicit type declaration where appropriate.

In fact, we tend to write our code in a way that makes vars suitable in almost 100% of cases. In scope of this changeset, it's up to reviewers to judge whether such an approach is still comprehensible and readable. But the final policy on var usage is yet to be defined.

Javac Extension

The Javac extensions which we have in buildSrc are modified to exclude that JDK8-only restriction that we had previously. This is only done in scope of this repository. Eventually, this restriction will have to be removed in config.

Error Prone

Error Prone's javac module is no longer enabled, as no custom compiler is required for Error Prone starting JDK 9.

Minor changes:

The version of the library is now set to 2.0.0-SNAPSHOT.63.

codecov[bot] commented 2 years ago

Codecov Report

Merging #169 (1ef1832) into master (5ee6d4b) will increase coverage by 0.23%. The diff coverage is 88.59%.

@@             Coverage Diff              @@
##             master     #169      +/-   ##
============================================
+ Coverage     87.14%   87.37%   +0.23%     
- Complexity      460      461       +1     
============================================
  Files            74       74              
  Lines          1742     1719      -23     
  Branches         81       81              
============================================
- Hits           1518     1502      -16     
+ Misses          194      188       -6     
+ Partials         30       29       -1