changeset 4286:df338e714f64

For consistency with runtime, disallow private and non-private qualified export of the same package to different modules.
author jlahoda
date Tue, 06 Sep 2016 15:11:25 +0200
parents 4af8cb38c00f
children d26b4bb63771
files src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java test/tools/javac/modules/ModuleInfoTest.java
diffstat 2 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java	Tue Sep 06 11:50:40 2016 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java	Tue Sep 06 15:11:25 2016 +0200
@@ -709,10 +709,8 @@
                         reportExportConflict(tree, packge);
                     }
                 } else {
-                    // both are qualified: error if dynamic and private match
-                    if (!(tree.isPrivate ^ d.isPrivate())) {
-                        reportExportConflict(tree, packge);
-                    }
+                    // both are qualified: error
+                    reportExportConflict(tree, packge);
                 }
             }
         }
--- a/test/tools/javac/modules/ModuleInfoTest.java	Tue Sep 06 11:50:40 2016 +0200
+++ b/test/tools/javac/modules/ModuleInfoTest.java	Tue Sep 06 15:11:25 2016 +0200
@@ -341,10 +341,10 @@
                                           "module-info.java:1:38: compiler.err.conflicting.exports: p");
         verifyConflictingExports_packages(base,
                                           "exports p to m2; exports private p to m3;",
-                                          null);
+                                          "module-info.java:1:46: compiler.err.conflicting.exports: p");
         verifyConflictingExports_packages(base,
                                           "exports private p to m2; exports p to m3;",
-                                          null);
+                                          "module-info.java:1:46: compiler.err.conflicting.exports: p");
         verifyConflictingExports_packages(base,
                                           "exports private p to m2; exports private p to m3;",
                                           "module-info.java:1:54: compiler.err.conflicting.exports: p");