Gildas Morvan created GROOVY-9611:
-------------------------------------

             Summary: Reflexive access to class attributes broken in Groovy 3
                 Key: GROOVY-9611
                 URL: https://issues.apache.org/jira/browse/GROOVY-9611
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 3.0.4
         Environment: macOs Catalina, openjdk 13.0.2 2020-01-14, Groovy 3.0.4
            Reporter: Gildas Morvan


Since Groovy 3, the reflexive access to Groovy class attributes from Java is 
broken.

 

The [following 
code|[https://github.com/gildasmorvan/similar2logo/blob/master/similar2logo-examples/src/main/groovy/fr/univ_artois/lgi2a/similar2logo/examples/boids/GroovyBoidsSimulation.groovy]]
 which works fine with groovy 2.5.* raises this exception:

 

{{}}

 
{code:java}
juin 30, 2020 9:01:33 AM 
fr.univ_artois.lgi2a.similar.extendedkernel.libs.web.view.SimilarHtmlGenerator 
renderParameter
WARNING: The parameter public double 
fr.univ_artois.lgi2a.similar2logo.examples.boids.GroovyBoidsSimulation$1.minInitialSpeed
 cannot be found
java.lang.IllegalAccessException: class 
fr.univ_artois.lgi2a.similar.extendedkernel.libs.web.view.SimilarHtmlGenerator 
cannot access a member of class 
fr.univ_artois.lgi2a.similar2logo.examples.boids.GroovyBoidsSimulation$1 with 
modifiers "public"
 at 
java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:376)
 at 
java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:642)
 at java.base/java.lang.reflect.Field.checkAccess(Field.java:1075)
 at java.base/java.lang.reflect.Field.get(Field.java:416)
 at 
fr.univ_artois.lgi2a.similar.extendedkernel.libs.web.view.SimilarHtmlGenerator.renderParameter(SimilarHtmlGenerator.java:290)
 at 
fr.univ_artois.lgi2a.similar.extendedkernel.libs.web.view.SimilarHtmlGenerator.lambda$renderParameters$4(SimilarHtmlGenerator.java:243)
 at 
java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
 at 
java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
 at 
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
 at 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
 at 
java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
 at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
 at 
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
 at 
java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
 at j2html.tags.ContainerTag.with(ContainerTag.java:100)
 at j2html.TagCreator.each(TagCreator.java:108)
 at 
fr.univ_artois.lgi2a.similar.extendedkernel.libs.web.view.SimilarHtmlGenerator.renderParameters(SimilarHtmlGenerator.java:243)
 at 
fr.univ_artois.lgi2a.similar.extendedkernel.libs.web.view.SimilarHtmlGenerator.renderView(SimilarHtmlGenerator.java:166)
 at 
fr.univ_artois.lgi2a.similar.extendedkernel.libs.web.view.SimilarHttpServer.lambda$initServer$0(SimilarHttpServer.java:112)
 at spark.RouteImpl$1.handle(RouteImpl.java:72)
 at spark.http.matching.Routes.execute(Routes.java:61)
 at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:134)
 at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
 at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1671)
 at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
 at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:61)
 at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
 at org.eclipse.jetty.server.Server.handle(Server.java:505)
 at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
 at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
 at 
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
 at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
 at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
 at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
 at 
org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
 at java.base/java.lang.Thread.run(Thread.java:830)
{code}
 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to