Skip to content

Commit

Permalink
Fix a bug in where Turbine would add java.base to the module graph of…
Browse files Browse the repository at this point in the history
… java.base itself.

PiperOrigin-RevId: 688642422
  • Loading branch information
gkdn authored and Javac Team committed Oct 22, 2024
1 parent d8c1bf2 commit ffafaff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion java/com/google/turbine/binder/ModuleBinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private SourceModuleInfo bind() {
break;
}
}
if (!requiresJavaBase) {
if (!requiresJavaBase && !module.module().moduleName().equals(ModuleSymbol.JAVA_BASE.name())) {
// Everything requires java.base, either explicitly or implicitly.
ModuleInfo javaBaseModule = moduleEnv.get(ModuleSymbol.JAVA_BASE);
// Tolerate a missing java.base module, e.g. when compiling a module against a non-modular
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public static Iterable<Object[]> parameters() {
"module-info.test", //
"classpath.test",
"multimodule.test",
"module-info-for-base.test",
"module-info-open.test",
"module-requires-static-transitive.test",
"module-requires-transitive-static.test",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
=== java/lang/Object.java ===
package java.lang;

public class Object {}

=== module-info.java ===
module java.base {}

0 comments on commit ffafaff

Please sign in to comment.