-
Bug
-
Resolution: Not an Issue
-
P4
-
20
-
None
mod/pkg/X.java ->
public class X {
public static void main(String[] args) {
System.out.println("Module mod's pkg.X.main");
}
}
mod/module-info.java ->
module mod {
exports pkg;
}
javac -d mod/module-info.java mod/pkg/X.java
java -p mod -m mod/pkg.X --> "Module mod's pkg.X.main" (Works as expected)
Now check the mod's exports flag:
java --jar <asmtools.jar> jdec mod/module-info.class > mod/module-info.jcod
Observe 'requires' table jcod line:48 is 0x0000. This value is neither ACC_MANDATED (0x8000) nor ACC_SYNTHETIC (0x1000).
As per jvms 4.7.25. The Module Attribute (assertion ids: jvms-4.7.25-300-D-I.1-B-A & jvms-4.7.25-300-D-I.1-B-B), above illustrated example should throw error.
Even if javac has produced erroneous class file, this should be rejected at VM.
public class X {
public static void main(String[] args) {
System.out.println("Module mod's pkg.X.main");
}
}
mod/module-info.java ->
module mod {
exports pkg;
}
javac -d mod/module-info.java mod/pkg/X.java
java -p mod -m mod/pkg.X --> "Module mod's pkg.X.main" (Works as expected)
Now check the mod's exports flag:
java --jar <asmtools.jar> jdec mod/module-info.class > mod/module-info.jcod
Observe 'requires' table jcod line:48 is 0x0000. This value is neither ACC_MANDATED (0x8000) nor ACC_SYNTHETIC (0x1000).
As per jvms 4.7.25. The Module Attribute (assertion ids: jvms-4.7.25-300-D-I.1-B-A & jvms-4.7.25-300-D-I.1-B-B), above illustrated example should throw error.
Even if javac has produced erroneous class file, this should be rejected at VM.