Hi all,
Our bug scanner has reported some NPE bugs.
1.The first bug is at Jar.java#L459 . Since the variable zis may be null , a NPE bug may take place when zis invokes its method getNextEntry() .
2.The second bug is at Capsule.java#L1715 . Since the variable server may be null , a NPE bug may take place when server invokes its method setSoTimeout() .
A similar situation is at Capsule.java#L5362 . (The variable out may be null.)
3.The third bug is at Capsule.java#L1229 . Since the variable defaultValue is checked for whether being null or not at Capsule.java#L1231 , a NPE bug may take place when defaultValue invokes its method equals() at Capsule.java#L1229 .
4.The forth bug is at Capsule.java#L3341 . Since the variable type is checked for whether being null or not at Capsule.java#L3351 , a NPE bug may take place when defaultValue invokes its method equals() at Capsule.java#L3341 .
5.The fifth bug is caused by the return null in method getAfter() . A NPE bug may take place when the return value of method getAfter() invokes its method substring() .
6.The sixth bug is caused by the return value of the method getAttribute0(). Since the if statement block may be skipped, the method getAttribute0() may return null. A possible call chain is attribute00() => attribute0() =>getAttribute() =>isDependency() . A NPE bug may take place in isDependency() when the parameter lib invokes its method contains() .
Some other NPE bugs are at Capsule.java#L2451 , Capsule.java#L843 , Capsule.java#L4001 , Capsule.java#L2514(when the method size() is invoked) .
7.The seventh bug is caused by the return null in method accessible() . A NPE may take place when the return value of method accessible() invokes its method set().
Some similar situations are at Capsule.java#L5637 , Capsule.java#L5476-5477 , Capsule.java#L5601 , Capsule.java#L5620
Another possible call chain is Capsule.java#L4835 =>Capsule.java#L4826 =>Capsule.java#L608 . And a NPE bug may take place when the method getDeclaringClass() is invoked.
The third possible call chain is Capsule.java#L4835 =>Capsule.java#L1311 . A NPE bug may take place when the method invoke() is invoked.
8.The eighth bug is caused by the return null in method toAbsolutePath() . A possible call chain is Capsule.java#L2067 =>Capsule.java#L2073 . And a NPE bug may take place in method extractCapsule() when the parameter dir invokes its method toAbsolutePath().
Another possible call chain is Capsule.java#L2067=>Capsule.java#L2070=>Capsule.java#L2104 . And a NPE bug may take place in method lockAppCache() when the parameter dir invokes its method resolve().
The third possible call chain is Capsule.java#L2067=>Capsule.java#L2070=>Capsule.java#L2105 . And a NPE bug may take place in method testAppCacheUpToDate() when the parameter dir invokes its method resolve().
Similar situations are at Capsule.java#L2072 => Capsule.java#L2088 , Capsule.java#L2070 => Capsule.java#L2107 => Capsule.java#L2173 .
9.The ninth bug is caused by the return null in method resolve() . A possible call chain is Capsule.java#L2228=>Capsule.java#L2234. And a NPE bug may take place in method handleLongClasspath() when the parameter cp invokes its method size().
Another call chain is Capsule.java#L2223=>Capsule.java#L2285=>Capsule.java#L4704 . A NPE bug may take place when the method iterator() is invoked.
10.The tenth bug is caused by the return null in method firstOrNull() . A NPE bug may take place at Capsule.java#L3542 when the method toString() of the parameter p is invoked.
11.The eleventh bug is caused by the return null in method name() . It may cause a NPE bug when the equals() method is invoked.
12.The twelfth bug is caused by the return null in method getCacheDir() . It may cause a NPE bug when the resolve() method is invoked.
13.The thirteenth bug is caused by the return null in method getProperty0() . A possible call chain is getProperty() =>Capsule.java#L218 . A NPE bug may take place when the method toLowerCase() is invoked.
14.The fourteenth bug is caused by the return null in method shortJavaVersion() . A NPE bug may take place when the method split() is invoked.
15.The fifteenth bug is caused by the return null in method lookupInAttribute() . A possible call chain is Capsule.java#L3181 => Capsule.java#L2735 => Capsule.java#L1492 . A NPE bug may take place when the booleanValue() method is invoked at Capsule.java#L1492.
16.The sixteenth bug is caused by the return null in method simpleResolve() . A possible call chain is Capsule.java#L3525 => Capsule.java#L3533 . A NPE bug may take place when the getParent() method is invoked .
17.The seventeenth bug is caused by the return null in method split() . A possible call chain is Capsule.java#L2445 => Capsule.java#L2446 . A NPE bug may take place when the remove() method is invoked .
18.The eighteenth bug is caused by the return null in method getTempDir() . A possible call chain is Capsule.java#L5290 . A NPE bug may take place in method createPathingJar() when the toAbsolutePath() method is invoked since the parameter dir may be null.
19.The nineteenth bug is caused by the return null in method getAppArtifactId() . A possible call chain is Capsule.java#L2655 =>Capsule.java#L2881 =>MyCapsule.java#L42 . And a NPE bug may take place when the method listIterator() is invoked.
20.The twentyth bug is caused by the return null in method getAppArtifactId() . A possible call chain is Capsule.java#L2672 =>Capsule.java#L2881 =>MyCapsule.java#L36 . And a NPE bug may take place when the method put() is invoked.
Thanks.
Hi all,
Our bug scanner has reported some NPE bugs.
1.The first bug is at Jar.java#L459 . Since the variable
zismay benull, a NPE bug may take place whenzisinvokes its methodgetNextEntry().2.The second bug is at Capsule.java#L1715 . Since the variable
servermay benull, a NPE bug may take place whenserverinvokes its methodsetSoTimeout().A similar situation is at Capsule.java#L5362 . (The variable
outmay benull.)3.The third bug is at Capsule.java#L1229 . Since the variable
defaultValueis checked for whether beingnullor not at Capsule.java#L1231 , a NPE bug may take place whendefaultValueinvokes its methodequals()at Capsule.java#L1229 .4.The forth bug is at Capsule.java#L3341 . Since the variable
typeis checked for whether beingnullor not at Capsule.java#L3351 , a NPE bug may take place whendefaultValueinvokes its methodequals()at Capsule.java#L3341 .5.The fifth bug is caused by the
return nullin method getAfter() . A NPE bug may take place when the return value of methodgetAfter()invokes its methodsubstring().6.The sixth bug is caused by the return value of the method getAttribute0(). Since the if statement block may be skipped, the method
getAttribute0()may returnnull. A possible call chain is attribute00() => attribute0() =>getAttribute() =>isDependency() . A NPE bug may take place inisDependency()when the parameterlibinvokes its methodcontains().Some other NPE bugs are at Capsule.java#L2451 , Capsule.java#L843 , Capsule.java#L4001 , Capsule.java#L2514(when the method
size()is invoked) .7.The seventh bug is caused by the
return nullin method accessible() . A NPE may take place when the return value of methodaccessible()invokes its methodset().Some similar situations are at Capsule.java#L5637 , Capsule.java#L5476-5477 , Capsule.java#L5601 , Capsule.java#L5620
Another possible call chain is Capsule.java#L4835 =>Capsule.java#L4826 =>Capsule.java#L608 . And a NPE bug may take place when the method
getDeclaringClass()is invoked.The third possible call chain is Capsule.java#L4835 =>Capsule.java#L1311 . A NPE bug may take place when the method
invoke()is invoked.8.The eighth bug is caused by the
return nullin method toAbsolutePath() . A possible call chain is Capsule.java#L2067 =>Capsule.java#L2073 . And a NPE bug may take place in method extractCapsule() when the parameterdirinvokes its methodtoAbsolutePath().Another possible call chain is Capsule.java#L2067=>Capsule.java#L2070=>Capsule.java#L2104 . And a NPE bug may take place in method lockAppCache() when the parameter
dirinvokes its methodresolve().The third possible call chain is Capsule.java#L2067=>Capsule.java#L2070=>Capsule.java#L2105 . And a NPE bug may take place in method testAppCacheUpToDate() when the parameter
dirinvokes its methodresolve().Similar situations are at Capsule.java#L2072 => Capsule.java#L2088 , Capsule.java#L2070 => Capsule.java#L2107 => Capsule.java#L2173 .
9.The ninth bug is caused by the
return nullin method resolve() . A possible call chain is Capsule.java#L2228=>Capsule.java#L2234. And a NPE bug may take place in method handleLongClasspath() when the parametercpinvokes its methodsize().Another call chain is Capsule.java#L2223=>Capsule.java#L2285=>Capsule.java#L4704 . A NPE bug may take place when the method
iterator()is invoked.10.The tenth bug is caused by the
return nullin method firstOrNull() . A NPE bug may take place at Capsule.java#L3542 when the method toString() of the parameterpis invoked.11.The eleventh bug is caused by the
return nullin method name() . It may cause a NPE bug when theequals()method is invoked.12.The twelfth bug is caused by the
return nullin method getCacheDir() . It may cause a NPE bug when theresolve()method is invoked.13.The thirteenth bug is caused by the
return nullin method getProperty0() . A possible call chain is getProperty() =>Capsule.java#L218 . A NPE bug may take place when the methodtoLowerCase()is invoked.14.The fourteenth bug is caused by the
return nullin method shortJavaVersion() . A NPE bug may take place when the methodsplit()is invoked.15.The fifteenth bug is caused by the
return nullin method lookupInAttribute() . A possible call chain is Capsule.java#L3181 => Capsule.java#L2735 => Capsule.java#L1492 . A NPE bug may take place when thebooleanValue()method is invoked at Capsule.java#L1492.16.The sixteenth bug is caused by the
return nullin method simpleResolve() . A possible call chain is Capsule.java#L3525 => Capsule.java#L3533 . A NPE bug may take place when thegetParent()method is invoked .17.The seventeenth bug is caused by the
return nullin method split() . A possible call chain is Capsule.java#L2445 => Capsule.java#L2446 . A NPE bug may take place when theremove()method is invoked .18.The eighteenth bug is caused by the
return nullin method getTempDir() . A possible call chain is Capsule.java#L5290 . A NPE bug may take place in methodcreatePathingJar()when thetoAbsolutePath()method is invoked since the parameterdirmay benull.19.The nineteenth bug is caused by the
return nullin method getAppArtifactId() . A possible call chain is Capsule.java#L2655 =>Capsule.java#L2881 =>MyCapsule.java#L42 . And a NPE bug may take place when the methodlistIterator()is invoked.20.The twentyth bug is caused by the
return nullin method getAppArtifactId() . A possible call chain is Capsule.java#L2672 =>Capsule.java#L2881 =>MyCapsule.java#L36 . And a NPE bug may take place when the methodput()is invoked.Thanks.