-
Bug
-
Resolution: Fixed
-
P3
-
24
-
b03
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8346486 | 24 | Jan Lahoda | P3 | Resolved | Fixed | b29 |
After https://github.com/openjdk/jdk/commit/1e97c1c913220b07ff0c1c977cea80bc9436729d, I'm seeing the following regression in a compilation that succeeded on earlier versions:
```
error: cannot access module-info
bad class file: /modules/java.se/module-info.class
bad requires flag: ACC_TRANSITIVE (0x0020
Please remove or make sure it appears in the correct subdirectory of the classpath.
1 error
```
The change adds a 'requires transitive java.base;` to java.se, and adds a special-case in src/java.base/share/classes/jdk/internal/module/ModuleInfo.java for the validation of 'requires transitive'.
There is no special case for java.se in src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java for that implementation of 'requires transitive' logic, should there be?
A simple, contrived repro is to compile a different version of java.base:
=== ./module-info.java ===
module java.base {
exports java.lang;
}
=== ./java/lang/Object.java ===
package java.lang;
public class Object {}
=== ./T.java ===
class T {
java.lang.instrument.ClassFileTransformer t;
}
javac --patch-module=java.base=. module-info.java java/lang/Object.java
jar cvf lib.jar module-info.class java/lang/Object.class
javac T.java --patch-module=java.base=lib.jar
error: cannot access module-info
bad class file: /modules/java.se/module-info.class
bad requires flag: ACC_TRANSITIVE (0x0020
Please remove or make sure it appears in the correct subdirectory of the classpath.
1 error
```
error: cannot access module-info
bad class file: /modules/java.se/module-info.class
bad requires flag: ACC_TRANSITIVE (0x0020
Please remove or make sure it appears in the correct subdirectory of the classpath.
1 error
```
The change adds a 'requires transitive java.base;` to java.se, and adds a special-case in src/java.base/share/classes/jdk/internal/module/ModuleInfo.java for the validation of 'requires transitive'.
There is no special case for java.se in src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java for that implementation of 'requires transitive' logic, should there be?
A simple, contrived repro is to compile a different version of java.base:
=== ./module-info.java ===
module java.base {
exports java.lang;
}
=== ./java/lang/Object.java ===
package java.lang;
public class Object {}
=== ./T.java ===
class T {
java.lang.instrument.ClassFileTransformer t;
}
javac --patch-module=java.base=. module-info.java java/lang/Object.java
jar cvf lib.jar module-info.class java/lang/Object.class
javac T.java --patch-module=java.base=lib.jar
error: cannot access module-info
bad class file: /modules/java.se/module-info.class
bad requires flag: ACC_TRANSITIVE (0x0020
Please remove or make sure it appears in the correct subdirectory of the classpath.
1 error
- backported by
-
JDK-8346486 Make java.se participate in the preview language feature `requires transitive java.base`
- Resolved
- relates to
-
JDK-8335989 Implement JEP 494: Module Import Declarations (Second Preview)
- Resolved
- links to
-
Commit(jdk24) openjdk/jdk/2cc14faa
-
Commit(master) openjdk/jdk/d50b725a
-
Review(jdk24) openjdk/jdk/22808
-
Review(master) openjdk/jdk/22322
(1 links to)