-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b135
-
Verified
Consider the following command:
javac -Xmodule:m -p mods -cp lib/junit-4.12.jar test/m/p/MyTest.java
which compiles a test "as if" part of module m (module m has already been compiled to mods/m).
module m is very simple:
src/m/module-info.java:
module m {
exports p;
}
src/m/p/Main.java:
package p;
public class Main { }
test/m/p/MyTest.java is:
package p;
import org.junit.Test;
import static org.junit.Assert.*;
public class MyTest {
@Test
public void testSomething() {
assertTrue(true);
}
}
Note that the test has references to JUnit tests that are on the class path.
It's not clear how this test compiled successful. It appears that when compiling with -Xmodule that the module is made to read the unnamed module. I can't otherwise explain it.
javac -Xmodule:m -p mods -cp lib/junit-4.12.jar test/m/p/MyTest.java
which compiles a test "as if" part of module m (module m has already been compiled to mods/m).
module m is very simple:
src/m/module-info.java:
module m {
exports p;
}
src/m/p/Main.java:
package p;
public class Main { }
test/m/p/MyTest.java is:
package p;
import org.junit.Test;
import static org.junit.Assert.*;
public class MyTest {
@Test
public void testSomething() {
assertTrue(true);
}
}
Note that the test has references to JUnit tests that are on the class path.
It's not clear how this test compiled successful. It appears that when compiling with -Xmodule that the module is made to read the unnamed module. I can't otherwise explain it.
- clones
-
JDK-8164745 javac -Xmodule compiles the module in a way that reads the unnamed module
-
- Closed
-