changeset 4294:78d769801dfa

Remove ModuleDescriptor::conceals, replace Builder::conceals with contains Update weak module build to disallow exports
author alanb
date Mon, 12 Sep 2016 04:18:35 +0100
parents 5be378ebc530
children b403a0007b81
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, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java	Sat Sep 10 15:57:20 2016 -0700
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java	Mon Sep 12 04:18:35 2016 +0100
@@ -38,6 +38,7 @@
 import java.io.UncheckedIOException;
 import java.lang.module.Configuration;
 import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleDescriptor.Exports;
 import java.lang.module.ModuleFinder;
 import java.lang.module.ModuleReader;
 import java.lang.module.ModuleReference;
@@ -408,7 +409,11 @@
             md.exports().forEach(builder::exports);
             md.provides().values().stream().forEach(builder::provides);
             md.uses().stream().forEach(builder::uses);
-            builder.conceals(md.conceals());
+
+            Set<String> concealed = new HashSet<>(md.packages());
+            md.exports().stream().map(Exports::source).forEach(concealed::remove);
+            concealed.forEach(builder::contains);
+
             return builder.build();
         }
 
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java	Sat Sep 10 15:57:20 2016 -0700
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/Module.java	Mon Sep 12 04:18:35 2016 +0100
@@ -26,6 +26,7 @@
 package com.sun.tools.jdeps;
 
 import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleDescriptor.Exports;
 import java.net.URI;
 import java.util.Collections;
 import java.util.HashMap;
@@ -250,7 +251,11 @@
             m.descriptor.exports().forEach(e -> builder.exports(e));
             m.descriptor.uses().forEach(s -> builder.uses(s));
             m.descriptor.provides().values().forEach(p -> builder.provides(p));
-            builder.conceals(m.descriptor.conceals());
+
+            Set<String> concealed = new HashSet<>(m.descriptor.packages());
+            m.descriptor.exports().stream().map(Exports::source).forEach(concealed::remove);
+            concealed.forEach(builder::contains);
+
             this.md = builder.build();
         }