8166538: Improve error reporting for compiling against unexported package

When a type cannot be found, look into other modules, search for possible viable types, and report them conveniently to the user.

Reviewed-by: mcimadamore, jjg
This commit is contained in:
Jan Lahoda 2016-11-02 16:48:57 +01:00
parent 0032be0658
commit 5daafbe43b
71 changed files with 1926 additions and 114 deletions

View file

@ -70,8 +70,8 @@ public class PackageMultipleModules extends ModuleTestBase {
.writeAll()
.getOutputLines(Task.OutputKind.DIRECT);
List<String> expected = Arrays.asList("A.java:1:26: compiler.err.not.def.access.package.cant.access: test.B, test",
"B.java:1:26: compiler.err.not.def.access.package.cant.access: test.A, test",
List<String> expected = Arrays.asList("A.java:1:22: compiler.err.package.not.visible: test, (compiler.misc.not.def.access.does.not.read: m1, test, m2)",
"B.java:1:22: compiler.err.package.not.visible: test, (compiler.misc.not.def.access.does.not.read: m2, test, m1)",
"2 errors");
if (!log.equals(expected))
throw new Exception("expected output not found");