-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b158
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8175694 | 10 | Jan Lahoda | P3 | Resolved | Fixed | b02 |
From:
http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-February/011337.html
---
src/moda/module-info.java:
module moda {
exports pkga;
}
src/moda/pkga/Outer.java:
package pkga;
class Outer {
public static class Untouchable {
public static void touch() {
throw new AssertionError("Can't touch this!");
}
}
}
src/modb/module-info.java:
module modb {
requires moda;
}
src/modb/pkgb/Intruder.java:
package pkgb;
public class Intruder {
public static void main(String[] args) {
pkga.Outer.Untouchable.touch();
}
}
$ javac -d out --module-path out --module-source-path src `find src
-name '*.java'`
src/modb/pkgb/Intruder.java:6: error: package pkga is not visible
pkga.Outer.Untouchable.touch();
^
(package pkga is declared in module moda, which does not export it to
module modb)
1 error
The error is confusing and incorrect.
http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-February/011337.html
---
src/moda/module-info.java:
module moda {
exports pkga;
}
src/moda/pkga/Outer.java:
package pkga;
class Outer {
public static class Untouchable {
public static void touch() {
throw new AssertionError("Can't touch this!");
}
}
}
src/modb/module-info.java:
module modb {
requires moda;
}
src/modb/pkgb/Intruder.java:
package pkgb;
public class Intruder {
public static void main(String[] args) {
pkga.Outer.Untouchable.touch();
}
}
$ javac -d out --module-path out --module-source-path src `find src
-name '*.java'`
src/modb/pkgb/Intruder.java:6: error: package pkga is not visible
pkga.Outer.Untouchable.touch();
^
(package pkga is declared in module moda, which does not export it to
module modb)
1 error
The error is confusing and incorrect.
- backported by
-
JDK-8175694 Incorrect error messages for inaccessible classes in visible packages
-
- Resolved
-