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

Groovy build fails test target using Java 1.7.0

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.6, 1.8-beta-3
    • Component/s: None
    • Labels:
      None

      Description

      These two tests fail and error respectively when running the Ant test target using Java 1.7.0-ea-b108:

      org.codehaus.groovy.ant.GroovycTest.testGroovyc_Joint_NoFork_NestedCompilerArg_WithGroovyClasspath
      org.codehaus.groovy.transform.DelegateTransformTest.testLock

        Issue Links

          Activity

          Hide
          malbery malbery added a comment -

          Regarding DelegateTransformTest.testLock:

          This will work:
          $ groovy -e 'class MyList

          { private List list }

          ; new MyList()'

          and this will NPE:
          $ groovy -e 'class MyList

          { @Delegate private List list }

          ; new MyList()'

          Show
          malbery malbery added a comment - Regarding DelegateTransformTest.testLock: This will work: $ groovy -e 'class MyList { private List list } ; new MyList()' and this will NPE: $ groovy -e 'class MyList { @Delegate private List list } ; new MyList()'
          Hide
          malbery malbery added a comment -

          The code that's failing in MetaClassImpl does work in isolation:

          $ groovy -e 'class MyList

          { private List list }

          ; java.security.AccessController.doPrivileged(

          { println java.beans.Introspector.getBeanInfo(MyList) }

          as java.security.PrivilegedExceptionAction)'

          Show
          malbery malbery added a comment - The code that's failing in MetaClassImpl does work in isolation: $ groovy -e 'class MyList { private List list } ; java.security.AccessController.doPrivileged( { println java.beans.Introspector.getBeanInfo(MyList) } as java.security.PrivilegedExceptionAction)'
          Hide
          malbery malbery added a comment -

          From looking at com.sun.beans.TypeResolver I'm guessing it's trying to inspect a List method parameter type that's badly formed (an array with no type):

          if (formal instanceof GenericArrayType) {
          Type comp = ((GenericArrayType)formal).getGenericComponentType();
          comp = resolve(comp);

          Show
          malbery malbery added a comment - From looking at com.sun.beans.TypeResolver I'm guessing it's trying to inspect a List method parameter type that's badly formed (an array with no type): if (formal instanceof GenericArrayType) { Type comp = ((GenericArrayType)formal).getGenericComponentType(); comp = resolve(comp);
          Hide
          malbery malbery added a comment -

          This is the stack trace generated by the erroring test:

          java.lang.NullPointerException
          at com.sun.beans.TypeResolver.resolve(TypeResolver.java:321)
          at com.sun.beans.TypeResolver.resolve(TypeResolver.java:303)
          at com.sun.beans.TypeResolver.resolve(TypeResolver.java:351)
          at com.sun.beans.TypeResolver.resolve(TypeResolver.java:172)
          at com.sun.beans.TypeResolver.resolveInClass(TypeResolver.java:93)
          at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:387)
          at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:114)
          at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:72)
          at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:56)
          at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1148)
          at java.beans.Introspector.getBeanInfo(Introspector.java:431)
          at java.beans.Introspector.getBeanInfo(Introspector.java:172)
          at groovy.lang.MetaClassImpl$15.run(MetaClassImpl.java:2931)
          at java.security.AccessController.doPrivileged(Native Method)
          at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:2929)
          at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2912)
          at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:166)
          at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:182)
          at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:214)
          at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:741)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallConstructorSite(CallSiteArray.java:69)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:52)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:194)
          at Script1.run(Script1.groovy:12)
          at groovy.lang.GroovyShell.evaluate(GroovyShell.java:576)
          at groovy.lang.GroovyShell.evaluate(GroovyShell.java:614)
          at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585)
          at groovy.lang.GroovyShell$evaluate.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
          at org.codehaus.groovy.transform.DelegateTransformTest.testLock(DelegateTransformTest.groovy:55)

          Show
          malbery malbery added a comment - This is the stack trace generated by the erroring test: java.lang.NullPointerException at com.sun.beans.TypeResolver.resolve(TypeResolver.java:321) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:303) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:351) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:172) at com.sun.beans.TypeResolver.resolveInClass(TypeResolver.java:93) at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:387) at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:114) at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:72) at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:56) at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1148) at java.beans.Introspector.getBeanInfo(Introspector.java:431) at java.beans.Introspector.getBeanInfo(Introspector.java:172) at groovy.lang.MetaClassImpl$15.run(MetaClassImpl.java:2931) at java.security.AccessController.doPrivileged(Native Method) at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:2929) at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2912) at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:166) at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:182) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:214) at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:741) at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallConstructorSite(CallSiteArray.java:69) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:52) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:194) at Script1.run(Script1.groovy:12) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:576) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:614) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585) at groovy.lang.GroovyShell$evaluate.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124) at org.codehaus.groovy.transform.DelegateTransformTest.testLock(DelegateTransformTest.groovy:55)
          Hide
          malbery malbery added a comment -

          The @Delegate issue may be specific to Collection and it's implementations.

          Show
          malbery malbery added a comment - The @Delegate issue may be specific to Collection and it's implementations.
          Hide
          hamletdrc Hamlet D'Arcy added a comment -

          this error does not occur on Java 1.7.0-ea-b111 64 bit ubuntu.

          Merlyn, what operating system are you using?
          Which maven target in Groovy did you invoke. "mvn clean install" worked find for me.

          Show
          hamletdrc Hamlet D'Arcy added a comment - this error does not occur on Java 1.7.0-ea-b111 64 bit ubuntu. Merlyn, what operating system are you using? Which maven target in Groovy did you invoke. "mvn clean install" worked find for me.
          Hide
          roshandawrani Roshan Dawrani added a comment -

          Merlyn/Hamlet, these issues should be fixed now. I have done the needed changes on 1.7.6 as well as on trunk(1.8-beta-3) and tested them locally with OpenJDK 7.

          Can you confirm from your ends?

          Show
          roshandawrani Roshan Dawrani added a comment - Merlyn/Hamlet, these issues should be fixed now. I have done the needed changes on 1.7.6 as well as on trunk(1.8-beta-3) and tested them locally with OpenJDK 7. Can you confirm from your ends?
          Hide
          roshandawrani Roshan Dawrani added a comment -

          Locally tested with OpenJDK(7) by me and then also verified by Merlyn.

          Show
          roshandawrani Roshan Dawrani added a comment - Locally tested with OpenJDK(7) by me and then also verified by Merlyn.
          Hide
          malbery malbery added a comment -

          Thanks for fixing this, Roshan.

          Show
          malbery malbery added a comment - Thanks for fixing this, Roshan.

            People

            • Assignee:
              roshandawrani Roshan Dawrani
              Reporter:
              malbery malbery
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development