java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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}
    via by Joe Athman,
  • 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}
    via by Joe Athman,
  • GitHub comment 23#152832957
    via GitHub by jtrancas
    ,
  • Support Hibernate 5.2.x
    via GitHub by todoubaba
    ,
    • 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)

    Users with the same issue

    derprogger
    1 times, last one,
    Unknown visitor2 times, last one,
    Unknown visitor2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    1 more bugmates