spotify / missinglink

Build time tool for detecting link problems in java projects
Apache License 2.0
146 stars 27 forks source link

Java 21 problems #345

Closed danslapman closed 8 months ago

danslapman commented 11 months ago

Hi! Recently I tried to migrate my build from JDK 17 to 21 and found that running missinglink on Java 21 results in tons of errors like that:

...
[warn] Could not read class java/lang/Module$1.class
[warn] Could not read class java/lang/Module$1DummyModuleInfo.class
[warn] Could not read class java/lang/Module$ArchivedData.class
[warn] Could not read class java/lang/Module$EnableNativeAccess.class
[warn] Could not read class java/lang/Module$ReflectionData.class
[warn] Could not read class java/lang/Module.class
[warn] Could not read class java/lang/ModuleLayer$Controller.class
[warn] Could not read class java/lang/ModuleLayer.class
[warn] Could not read class java/lang/NamedPackage.class
[warn] Could not read class java/lang/NegativeArraySizeException.class
[warn] Could not read class java/lang/NoClassDefFoundError.class
[warn] Could not read class java/lang/NoSuchFieldError.class
[warn] Could not read class java/lang/NoSuchFieldException.class
[warn] Could not read class java/lang/NoSuchMethodError.class
[warn] Could not read class java/lang/NoSuchMethodException.class
[warn] Could not read class java/lang/NullPointerException.class
[warn] Could not read class java/lang/Number.class
...

causing literally any class to be problematic afterwards:

[error]       --------
[error]       In method:  toString():1083
[error]       Call to: java.lang.StringBuilder.toString()
[error]       Problem: Class not found: java.lang.StringBuilder
[error]       --------
[error]       In method:  toString():1081
[error]       Call to: java.lang.String.format(java.lang.String, java.lang.Object[])
[error]       Problem: Class not found: java.lang.String
[error]       --------

(complete build log can be found here)

danslapman commented 8 months ago

Works fine in 0.2.11