JDK-7179567 : JCK8 tests: api/java_net/URLClassLoader/index.html#Ctor3 failed with NPE
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2012-06-25
  • Updated: 2018-03-01
  • Resolved: 2013-10-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b115Fixed
Related Reports
Relates :  
Relates :  
Description
URLClassLoader throws an NPE in constructor if first argument URLs[] is null.

According to javadoc, it throws a SecurityException only. It either should work without NPE, or declare for example IllegalArgumentException to be thrown - not NPE.

Code example: 
    public Status Ctor3T100() {
        TestURLClassLoader ucl = null;
               try {
                  ucl = new TestURLClassLoader(null, new ParentClassLoader(), new TestURLStreamHandlerFactory());
               } catch (SecurityException se) {
                  return checkCreateClassLoader();
               }
               return Status.passed("OKAY");

            }

this code throws an NPE at line:  ucl = new TestURLClassLoader(null, new ParentClassLoader(), new TestURLStreamHandlerFactory());

There is also a sample code which provides non-null, but empty URLs[]. It also throws an NPE later, during findClass call.

Affected tests: 
api/java_net/URLClassLoader/index.html#Ctor3[Ctor3T100]
api/java_net/URLClassLoader/index.html#Ctor3[Ctor3T103]
api/java_net/URLClassLoader/index.html#findClass[findClassT108]
api/java_net/URLClassLoader/index.html#getPermissions[getPermissionsT104]

Note: these tests are not present in JDK7 and exists only in JDK8.

Comments
Loks like still reproducible with JDK8 b115 abd JCK8 b34 http://aurora.ru.oracle.com/functional/faces/RunDetails.xhtml?names=317231.JAVASE_EMBEDDED_PROMOTION_TESTCYCLE_8_ALL-80
13-11-2013

No failures of java/net/URLClassLoader/NullURLTest.java in nightly: http://aurora.ru.oracle.com/functional/faces/ChessBoard.xhtml?reportName=J2SEFailures&parameters=%5BtestNameFilterRegExp%5Djava%2Fnet%2FURLClassLoader%2FNullURLTest.java%5Bjdkproduct%5DJava%28TM%29%25%5Brelease%5D1.8.0%5Bbuild%5D%25%5Bvmproduct%5DJava%25VM%25%5Bvmrelease%5D%25%5Bvmbuild%5D%25%5Bcomponent%5D%25%5Btags%5D%25%5BstartDate%5DSep+10%2C+2009+1%3A00%3A00+AM+MSD%5BendDate%5DSep+10%2C+2020+1%3A00%3A00+AM+MSK%5BrunNames%5D%27%27%5BbatchNames%5D%27%27%5BbatchNameFilterRegExp%5D%25%5BrunNameFilterRegExp%5D%25%5BtestsuiteNameFilterRegExp%5D%25%5Bstatuses%5D%281%3D1%29%5Bmatches%5D%281%3D1%29%5Bbundles%5Dnone&splitting=%5BY+axis%5Dfailure%2C+reason%2C+productConfiguration%2C+release%2C+build%2C+date%2C+buildType%5BZ+axis%5D%5BX+axis%5Dos%2C+bitness%5BComplement%5Dvmrelease%2C+vmbuild%2C+VMVersionString%2C+JDKVersionString%2C+tags%2C+groups%2C+platform%2C+truncatedProductConfiguration%2C+VMMode%2C+JDKProfile%2C+VMFlavor%2C+hostname%2C+osFlavor%2C+osVersion%2C+buildDate%2C+msDate%2C+baseline%2C+emb_arch%2C+batch%2C+runName%2C+harness%2C+testbaseVersion%2C+testbase%2C+fullTestsuite%2C+testsuite%2C+component%2C+baselineName%2C+crs%2C+bugType%2C+duration&reference=%5BOthers%5Drelease%2C+build%2C+vmrelease%2C+vmbuild%2C+VMVersionString%2C+JDKVersionString%2C+tags%2C+groups%2C+platform%2C+truncatedProductConfiguration%2C+buildType%2C+bitness%2C+productConfiguration%2C+VMMode%2C+JDKProfile%2C+VMFlavor%2C+hostname%2C+os%2C+osFlavor%2C+osVersion%2C+date%2C+buildDate%2C+msDate%2C+baseline%2C+emb_arch%2C+batch%2C+runName%2C+harness%2C+testbaseVersion%2C+testbase%2C+fullTestsuite%2C+testsuite%2C+component%2C+baselineName%2C+failure%2C+reason%2C+crs%2C+bugType%2C+duration%5BReference+Set%5D&mixReference=false&flags=&significance=empty&hideDataConfiguration=false&calculateSummary=false&showSummaryExpanded=false&showSummaryContents=true&showComplementAttributes=false&compactTables=true&viewStyle=chessboard&filter_override=
13-11-2013

Also failed with NPE api/java_net/URLClassLoader/index.html#getPermissions[getPermissionsT103]
11-09-2013