changeset 4263:983bd135b79d

Initial runtime support for `exports private`
author alanb
date Sat, 20 Aug 2016 20:29:41 +0100
parents 90a30f352895
children d39d31cff220
files src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleAnalyzer.java test/tools/jdeps/lib/ModuleMetaData.java
diffstat 3 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java	Sat Aug 20 08:47:48 2016 +0100
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java	Sat Aug 20 20:29:41 2016 +0100
@@ -242,7 +242,7 @@
             ModuleDescriptor.Builder builder = new ModuleDescriptor.Builder(m.name());
             requires.keySet().forEach(mn -> {
                 if (requires.get(mn).equals(Boolean.TRUE)) {
-                    builder.requires(Set.of(ModuleDescriptor.Requires.Modifier.PUBLIC), mn);
+                    builder.requires(Set.of(ModuleDescriptor.Requires.Modifier.TRANSITIVE), mn);
                 } else {
                     builder.requires(mn);
                 }
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleAnalyzer.java	Sat Aug 20 08:47:48 2016 +0100
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/ModuleAnalyzer.java	Sat Aug 20 20:29:41 2016 +0100
@@ -168,7 +168,7 @@
             requiresPublic.stream()
                 .filter(m -> !m.name().equals(JAVA_BASE))
                 .map(Module::name)
-                .forEach(mn -> builder.requires(Set.of(PUBLIC), mn));
+                .forEach(mn -> builder.requires(Set.of(TRANSITIVE), mn));
 
             requires.stream()
                 .filter(m -> !requiresPublic.contains(m))
@@ -303,7 +303,7 @@
                 builder.addNode(source);
                 Module from = source;
                 source.descriptor().requires().stream()
-                    .filter(req -> req.modifiers().contains(PUBLIC))
+                    .filter(req -> req.modifiers().contains(TRANSITIVE))
                     .map(ModuleDescriptor.Requires::name)
                     .map(configuration::findModule)
                     .flatMap(Optional::stream)
@@ -367,10 +367,10 @@
     private boolean matches(ModuleDescriptor md, ModuleDescriptor other) {
         // build requires public from ModuleDescriptor
         Set<ModuleDescriptor.Requires> reqPublic = md.requires().stream()
-            .filter(req -> req.modifiers().contains(PUBLIC))
+            .filter(req -> req.modifiers().contains(TRANSITIVE))
             .collect(toSet());
         Set<ModuleDescriptor.Requires> otherReqPublic = other.requires().stream()
-            .filter(req -> req.modifiers().contains(PUBLIC))
+            .filter(req -> req.modifiers().contains(TRANSITIVE))
             .collect(toSet());
 
         if (!reqPublic.equals(otherReqPublic)) {
@@ -422,7 +422,7 @@
                 .forEach(md -> {
                     String mn = md.name();
                     Set<String> requiresPublic = md.requires().stream()
-                        .filter(d -> d.modifiers().contains(PUBLIC))
+                        .filter(d -> d.modifiers().contains(TRANSITIVE))
                         .map(d -> d.name())
                         .collect(toSet());
 
@@ -449,7 +449,7 @@
             ModuleDescriptor md = module.descriptor();
             String mn = md.name();
             md.requires().stream()
-                    .filter(d -> d.modifiers().contains(PUBLIC))
+                    .filter(d -> d.modifiers().contains(TRANSITIVE))
                     .map(d -> d.name())
                     .forEach(d -> rpgbuilder.addEdge(mn, d));
         }
--- a/test/tools/jdeps/lib/ModuleMetaData.java	Sat Aug 20 08:47:48 2016 +0100
+++ b/test/tools/jdeps/lib/ModuleMetaData.java	Sat Aug 20 20:29:41 2016 +0100
@@ -71,7 +71,7 @@
     }
 
     ModuleMetaData requiresPublic(String name) {
-        requires.put(name, new ModuleRequires(name, PUBLIC));
+        requires.put(name, new ModuleRequires(name, TRANSITIVE));
         return this;
     }