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

A groovyc BUG when using jdk 11.0.1

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.0.0-alpha-3
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
      None
    • Environment:
      Intellij Gradle Build

      Description

      The source code (I tried to attach files but it would not work giving me a JIRA error sorry):

      package gppLibrary.terminals.GUIsupport
      
      import gppLibrary.*
      import groovy.transform.CompileStatic
      import jcsp.awt.*
      import jcsp.lang.*
      
      @CompileStatic
      class GUImanager implements CSProcess {
      
        ChannelInput input
        DisplayList dList
        ResultDetails guiDetails
        // def resultsClass
        // List finaliseData = null
      
        void run() {
          def guiClass = Class.forName(guiDetails.rName)
          def rc = guiClass.newInstance()
          int retCode = rc.&"${guiDetails.rInitMethod}"( guiDetails.rInitData << dList )
          // can do the timing from here
         def startime = System.currentTimeMillis()
         def inputObject = input.read()
         while (!(inputObject instanceof UniversalTerminator)) {
            retCode = rc.&"${guiDetails.rCollectMethod}"( inputObject, dList )
            if (retCode == DataClassInterface.completedOK )
                 inputObject = input.read()
           else
                gppLibrary.DataClass.unexpectedReturnCode("GUImanager: error while displaying", retCode)
          }
          retCode = rc.&"${guiDetails.rFinaliseMethod}"( guiDetails.rFinaliseData )
          if (retCode != DataClassInterface.completedOK)
            gppLibrary.DataClass.unexpectedReturnCode("GUImanager: error while finalising", retCode)
          // print out the elapsed time
          def endtime = System.currentTimeMillis()
          def elapsedTime = endtime - startime
          println "Time taken = ${elapsedTime} milliseconds"
        }
      }
      

      The Gradle build is below:

      repositories {
        mavenCentral()
        jcenter()
        maven {
          url "https://dl.bintray.com/jonkerridge/jcsp"
        }
        // following required for groovy-all:3.0.0
       maven {
         url "https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-all"
        }
      }
      
      dependencies {
       compile {color:#008000}'org.codehaus.groovy:groovy-all:3.0.0-alpha-3'
      {color} compile {color:#008000}'cspforjava:jcsp:1.1.0'
      {color} compile {color:#008000}'groovyJCSP:groovyJCSP:1.1.3'
      {color} compile {color:#008000}group{color}: {color:#008000}'junit'{color}, {color:#008000}name{color}: {color:#008000}'junit'{color}, {color:#008000}version{color}: {color:#008000}'4.12'
      {color} compile {color:#008000}group{color}: {color:#008000}'javax.xml.bind'{color}, {color:#008000}name{color}: {color:#008000}'jaxb-api'{color}, {color:#008000}version{color}: {color:#008000}'2.3.0'
      {color} testCompile {color:#008000}'org.codehaus.groovy:groovy-all:3.0.0-alpha-3'
      {color} testCompile {color:#008000}'cspforjava:jcsp:1.1.0'
      {color} testCompile {color:#008000}'groovyJCSP:groovyJCSP:1.1.3'
      {color} testCompile {color:#008000}group{color}: {color:#008000}'junit'{color}, {color:#008000}name{color}: {color:#008000}'junit'{color}, {color:#008000}version{color}: {color:#008000}'4.12'
      {color} testCompile {color:#008000}group{color}: {color:#008000}'javax.xml.bind'{color}, {color:#008000}name{color}: {color:#008000}'jaxb-api'{color}, {color:#008000}version{color}: {color:#008000}'2.3.0'
      {color}}
      

      The error message is:

      Error:Groovyc: While compiling gppLibrary_main: BUG! exception in phase 'semantic analysis' in source unit 'D:\IJGradle\gppLibrary\src\main\groovy\gppLibrary\terminals\GUIsupport\GUImanager.groovy' null
          at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:972)
          at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:633)
          at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:582)
          at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:62)
          at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:119)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:566)
          at org.jetbrains.groovy.compiler.rt.GroovycRunner.intMain2(GroovycRunner.java:90)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:566)
          at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.runGroovycInThisProcess(InProcessGroovyc.java:160)
          at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.lambda$runGroovyc$0(InProcessGroovyc.java:89)
          at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.lang.UnsupportedOperationException
          at groovyjarjarasm.asm.ClassVisitor.visitNestMemberExperimental(ClassVisitor.java:248)
          at groovyjarjarasm.asm.ClassReader.accept(ClassReader.java:651)
          at groovyjarjarasm.asm.ClassReader.accept(ClassReader.java:391)
          at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:83)
          at org.codehaus.groovy.control.ClassNodeResolver.findDecompiled(ClassNodeResolver.java:254)
          at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:192)
          at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:172)
          at org.codehaus.groovy.control.ClassNodeResolver.resolveName(ClassNodeResolver.java:128)
          at org.codehaus.groovy.control.ResolveVisitor.resolveToOuter(ResolveVisitor.java:742)
          at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:392)
          at org.codehaus.groovy.control.ResolveVisitor.resolveFromDefaultImports(ResolveVisitor.java:520)
          at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:390)
          at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:353)
          at org.codehaus.groovy.control.ResolveVisitor.transformVariableExpression(ResolveVisitor.java:1009)
          at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:760)
          at org.codehaus.groovy.control.ResolveVisitor.transformMethodCallExpression(ResolveVisitor.java:1156)
          at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:768)
          at org.codehaus.groovy.control.ResolveVisitor.transformDeclarationExpression(ResolveVisitor.java:1181)
          at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:764)
          at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:144)
          at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
          at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:85)
          at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
          at org.codehaus.groovy.control.ResolveVisitor.visitBlockStatement(ResolveVisitor.java:1431)
          at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
          at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:110)
          at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:121)
          at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:55)
          at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(ResolveVisitor.java:246)
          at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:132)
          at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1140)
          at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54)
          at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1375)
          at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:219)
          at org.codehaus.groovy.control.CompilationUnit$13.call(CompilationUnit.java:691)
          at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:968)
          ... 19 more

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              JonKerridge Jon Kerridge
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: