changeset 4490:3f46df92ca42

Filter open packages when calling Builder::contains
author mchung
date Wed, 30 Nov 2016 17:57:50 -0800
parents c64079dbb1ba
children fcee76c3e79f
files src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java	Wed Nov 30 14:46:33 2016 -0800
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java	Wed Nov 30 17:57:50 2016 -0800
@@ -39,6 +39,7 @@
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleDescriptor.Exports;
+import java.lang.module.ModuleDescriptor.Opens;
 import java.lang.module.ModuleFinder;
 import java.lang.module.ModuleReader;
 import java.lang.module.ModuleReference;
@@ -425,11 +426,13 @@
             ModuleDescriptor.Builder builder = ModuleDescriptor.module(md.name());
             md.requires().forEach(builder::requires);
             md.exports().forEach(builder::exports);
+            md.opens().forEach(builder::opens);
             md.provides().stream().forEach(builder::provides);
             md.uses().stream().forEach(builder::uses);
 
             Set<String> concealed = new HashSet<>(md.packages());
             md.exports().stream().map(Exports::source).forEach(concealed::remove);
+            md.opens().stream().map(Opens::source).forEach(concealed::remove);
             concealed.forEach(builder::contains);
 
             return builder.build();
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java	Wed Nov 30 14:46:33 2016 -0800
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java	Wed Nov 30 17:57:50 2016 -0800
@@ -27,6 +27,7 @@
 
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleDescriptor.Exports;
+import java.lang.module.ModuleDescriptor.Opens;
 import java.net.URI;
 import java.util.Collections;
 import java.util.HashMap;
@@ -250,11 +251,13 @@
                 }
             });
             m.descriptor.exports().forEach(e -> builder.exports(e));
+            m.descriptor.opens().forEach(o -> builder.opens(o));
             m.descriptor.uses().forEach(s -> builder.uses(s));
             m.descriptor.provides().forEach(p -> builder.provides(p));
 
             Set<String> concealed = new HashSet<>(m.descriptor.packages());
             m.descriptor.exports().stream().map(Exports::source).forEach(concealed::remove);
+            m.descriptor.opens().stream().map(Opens::source).forEach(concealed::remove);
             concealed.forEach(builder::contains);
 
             this.md = builder.build();