Package return values changed
sormuras opened this issue · 5 comments
sormuras commented
Having a class like DefaultPackageTestCase
defined in the default package, the result of DefaultPackageTestCase.class.getPackage()
differ. See following code:
System.out.println("Java version = " + Runtime.class.getPackage().getImplementationVersion());
System.out.println(" class = |" + DefaultPackageTestCase.class + "|");
System.out.println("package = |" + DefaultPackageTestCase.class.getPackage() + "|");
System.out.println(" name = |" + DefaultPackageTestCase.class.getPackage().getName() + "|");
Java 8
Java version = 1.8.0_121
class = |class DefaultPackageTestCase|
package = |null|
java.lang.NullPointerException
Java 9
Java version = null
class = |class DefaultPackageTestCase|
package = |package |
name = ||
AlanBateman commented
The java.lang.Package API has been overhauled for Java SE 9 so that it works with modules. See the javadoc for more on this.
sormuras commented
I'm with Mikhail here: I inlined "the test case right here because I believe you have better idea how to integrate it into your compiler module"