Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9462

Groovy 3 BUG! exception in phase 'conversion' in source unit Caused by NullPointerException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.2
    • Fix Version/s: 4.0.0-alpha-1, 3.0.3
    • Component/s: Compiler
    • Labels:
      None

      Description

      After updating to Groovy 3.0.3-SNAPSHOT we are seeing the following exception:

      Caused by: BUG! exception in phase 'conversion' in source unit '~/gorm-neo4j/grails-datastore-gorm-neo4j/src/main/groovy/org/grails/datastore/gorm/neo4j/collection/Neo4jRelationship.groovy' unexpected NullPointerException
       at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:179)
       at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:57)
       at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:80)
       at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:68)
       at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:86)
       at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:74)
       at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:42)
       at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:36)
       at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:102)
       at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
       at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
       at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
       at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
       at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
       ... 3 more
      Caused by: java.lang.NullPointerException
       ... 17 more
      

      I tried to debug the problem and found out that the NullPointerException is caused by JavaStubGenerator.printType method in the following lines:

      out.print(type.getGenericsTypes()[0].getName());
      

      In the above code, the ClassNode type is the return type of the getter method getFrom in the class Relationship.groovy where type.getGenericsTypes() is now a null value.

      Please clone the following repository and run ./gradlew :grails-datastore-gorm-neo4j:testClasses task to replicate the error:
      https://github.com/grails/gorm-neo4j/tree/groovy3

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emilles Eric Milles
                Reporter:
                behlp Puneet Behl
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h