Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.3
-
None
-
java --version
openjdk 17.0.3 2022-04-19
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode, sharing)
Description
Groovy GDK method dump() produces errors at least since Jave version 16.
Example:
println(new File("foo").dump())
produces
<java.io.File@135957 path=java.lang.IllegalAccessException: class org.codehaus.groovy.runtime.DefaultGroovyMethods cannot access a member of class java.io.File (in module java.base) with modifiers "private final" status=java.lang.IllegalAccessException: class org.codehaus.groovy.runtime.DefaultGroovyMethods cannot access a member of class java.io.File (in module java.base) with modifiers "private transient" prefixLength=java.lang.IllegalAccessException: class org.codehaus.groovy.runtime.DefaultGroovyMethods cannot access a member of class java.io.File (in module java.base) with modifiers "private final transient" filePath=java.lang.IllegalAccessException: class org.codehaus.groovy.runtime.DefaultGroovyMethods cannot access a member of class java.io.File (in module java.base) with modifiers "private transient volatile">
To me the best solution would be to respect Java's access modifiers.