changeset 4292:9cdc06f40dee

'Duplicate' private and non-private qualified exports should be allowed
author jlahoda
date Fri, 09 Sep 2016 12:46:15 +0200
parents 17508720b146
children 5be378ebc530
files src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java test/jdk/jshell/JDIListeningExecutionControlTest.java test/tools/javac/modules/ModuleInfoTest.java
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java	Fri Sep 09 11:03:12 2016 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java	Fri Sep 09 12:46:15 2016 +0200
@@ -712,8 +712,10 @@
                         reportExportConflict(tree, packge);
                     }
                 } else {
-                    // both are qualified: error
-                    reportExportConflict(tree, packge);
+                    // both are qualified: error if private match
+                    if (!(tree.isPrivate ^ d.isPrivate())) {
+                        reportExportConflict(tree, packge);
+                    }
                 }
             }
         }
--- a/test/tools/javac/modules/ModuleInfoTest.java	Fri Sep 09 11:03:12 2016 +0100
+++ b/test/tools/javac/modules/ModuleInfoTest.java	Fri Sep 09 12:46:15 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;",
-                                          "module-info.java:1:46: compiler.err.conflicting.exports: p");
+                                          null);
         verifyConflictingExports_packages(base,
                                           "exports private p to m2; exports p to m3;",
-                                          "module-info.java:1:46: compiler.err.conflicting.exports: p");
+                                          null);
         verifyConflictingExports_packages(base,
                                           "exports private p to m2; exports private p to m3;",
                                           "module-info.java:1:54: compiler.err.conflicting.exports: p");