java.lang.NullPointerException

Atlassian JIRA | Joe Athman | 1 year ago
  1. 0

    Starting with Clover version 4.0.1 when running JUnit tests against clover instrumented code I am getting a null pointer exception when attempting to call this method: {code:java} // in DateUtil.groovy static <T extends Date> T copy(T date) { (T) date?.clone() } {code} It seems like something has changed with the instrumentation. Either of these two other variations of this same code *doesn't* have this problem: {code:java} static Date copy(Date date) { date?.clone() } static def copy(def date) { date?.clone() } {code} Here's the top of the stacktrace: {noformat} java.lang.NullPointerException at com.sun.beans.TypeResolver.resolve(TypeResolver.java:203) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:218) at com.sun.beans.TypeResolver.resolveInClass(TypeResolver.java:96) at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:387) at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:116) at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:72) at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:56) at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1205) at java.beans.Introspector.getBeanInfo(Introspector.java:426) at java.beans.Introspector.getBeanInfo(Introspector.java:173) at groovy.lang.MetaClassImpl$15.run(MetaClassImpl.java:3244) at java.security.AccessController.doPrivileged(Native Method) at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3242) at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3225) at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:222) at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:253) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:255) at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:859) at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:72) at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:159) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at com.surescripts.common.DateUtilTest.clone_NonNullValue(DateUtilTest.groovy:16) {noformat}

    Atlassian JIRA | 1 year ago | Joe Athman
    java.lang.NullPointerException
  2. 0

    Starting with Clover version 4.0.1 when running JUnit tests against clover instrumented code I am getting a null pointer exception when attempting to call this method: {code:java} // in DateUtil.groovy static <T extends Date> T copy(T date) { (T) date?.clone() } {code} It seems like something has changed with the instrumentation. Either of these two other variations of this same code *doesn't* have this problem: {code:java} static Date copy(Date date) { date?.clone() } static def copy(def date) { date?.clone() } {code} Here's the top of the stacktrace: {noformat} java.lang.NullPointerException at com.sun.beans.TypeResolver.resolve(TypeResolver.java:203) at com.sun.beans.TypeResolver.resolve(TypeResolver.java:218) at com.sun.beans.TypeResolver.resolveInClass(TypeResolver.java:96) at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:387) at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:116) at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:72) at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:56) at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1205) at java.beans.Introspector.getBeanInfo(Introspector.java:426) at java.beans.Introspector.getBeanInfo(Introspector.java:173) at groovy.lang.MetaClassImpl$15.run(MetaClassImpl.java:3244) at java.security.AccessController.doPrivileged(Native Method) at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3242) at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3225) at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:222) at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:253) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:255) at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:859) at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:72) at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:159) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at com.surescripts.common.DateUtilTest.clone_NonNullValue(DateUtilTest.groovy:16) {noformat}

    Atlassian JIRA | 1 year ago | Joe Athman
    java.lang.NullPointerException
  3. 0

    GitHub comment 23#152832957

    GitHub | 1 year ago | jtrancas
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    4 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.sun.beans.TypeResolver.resolve()
    2. Java RT
      Introspector.getBeanInfo
      1. com.sun.beans.TypeResolver.resolve(TypeResolver.java:203)
      2. com.sun.beans.TypeResolver.resolve(TypeResolver.java:218)
      3. com.sun.beans.TypeResolver.resolveInClass(TypeResolver.java:96)
      4. java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:387)
      5. java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:116)
      6. java.beans.MethodDescriptor.<init>(MethodDescriptor.java:72)
      7. java.beans.MethodDescriptor.<init>(MethodDescriptor.java:56)
      8. java.beans.Introspector.getTargetMethodInfo(Introspector.java:1205)
      9. java.beans.Introspector.getBeanInfo(Introspector.java:426)
      10. java.beans.Introspector.getBeanInfo(Introspector.java:173)
      10 frames
    3. Groovy
      MetaClassImpl$15.run
      1. groovy.lang.MetaClassImpl$15.run(MetaClassImpl.java:3244)
      1 frame
    4. Java RT
      AccessController.doPrivileged
      1. java.security.AccessController.doPrivileged(Native Method)
      1 frame
    5. Groovy
      AbstractCallSite.call
      1. groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3242)
      2. groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3225)
      3. org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:222)
      4. org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:253)
      5. org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:255)
      6. org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:859)
      7. org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:72)
      8. org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:159)
      9. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
      10. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      11. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
      11 frames
    6. com.surescripts.common
      DateUtilTest.clone_NonNullValue
      1. com.surescripts.common.DateUtilTest.clone_NonNullValue(DateUtilTest.groovy:16)
      1 frame