Java analyzer compile error after upgrading to OpenJDK11

Hey @Martin_Roucek,

After investigation, it seems that we won’t be able to do anything about this issue on our side at short term.

It took me quite a lot of time to figure it out the change of behavior between and JDK8 and JDK11, and in order to understand the root causes, I had to dig into the dependencies of your reproducing project.

To me, the issue is unfortunately on your side, as your project is hitting the problem of “split package”. More concretely, starting with JDK9 and introduction of modules, it is now forbidden to declare partial packages, or to enrich a package from another dependencies with your own. This kind of issues appears exactly when moving from Java 8 to the next LTS, aka Java 11.

Now, the problem is that you might be affected by some of your dependencies doing it, even if you are not using it yourself directly in your code.

In your case, the faulty dependency is OpenHFT/Java Thread Affinity/affinity (affinity-3.2.2.jar). It declares two classes in the java.lang package. When exploring dependencies and building the corresponding classpath, ECJ follows restrictions which forbid splitting packages and “lose” track of the rest of java.lang. This does not happen when using java 8, as it is allowed (or more explicitly, not forbidden).

Some links which might help you to figure it more:

While we agree that the current way our analyzer is failing due to this issue is not nice, I’m however afraid we can not provide any easy solution for the time being.

Hope this helps,
Michael