You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Alexander Veit (Jira)" <ji...@apache.org> on 2022/07/18 15:53:00 UTC

[jira] [Created] (GROOVY-10690) dump() method produces errors

Alexander Veit created GROOVY-10690:
---------------------------------------

             Summary: dump() method produces errors
                 Key: GROOVY-10690
                 URL: https://issues.apache.org/jira/browse/GROOVY-10690
             Project: Groovy
          Issue Type: Bug
          Components: groovy-jdk
    Affects Versions: 4.0.3
         Environment: 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)
            Reporter: Alexander Veit


Groovy GDK method {{dump()}} produces errors at least since Jave version 16.

Example:
{code:java}
println(new File("foo").dump())
{code}
produces
{noformat}
<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">
{noformat}
To me the best solution would be to respect Java's access modifiers.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)