You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2018/03/03 20:04:09 UTC

[GitHub] jlahoda closed pull request #435: [NETBEANS-405] Avoiding use of internal classes, searching boot class?

jlahoda closed pull request #435: [NETBEANS-405] Avoiding use of internal classes, searching boot class?
URL: https://github.com/apache/incubator-netbeans/pull/435
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/java.module.graph/src/org/netbeans/modules/java/module/graph/DependencyCalculator.java b/java.module.graph/src/org/netbeans/modules/java/module/graph/DependencyCalculator.java
index 1da745dd1..e13cc4e9d 100644
--- a/java.module.graph/src/org/netbeans/modules/java/module/graph/DependencyCalculator.java
+++ b/java.module.graph/src/org/netbeans/modules/java/module/graph/DependencyCalculator.java
@@ -20,10 +20,7 @@
 
 import com.sun.source.tree.Tree;
 import com.sun.source.util.TreePath;
-import com.sun.tools.javac.code.Symbol;
 import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -156,19 +153,11 @@ private void collect(
     }   
 
     private boolean isJDK(final ModuleElement me, ClasspathInfo cpinfo) {
-        boolean isJDK = false;
-        Symbol.ClassSymbol mi = ((Symbol.ModuleSymbol) me).module_info;
-        JavaFileObject cf = mi != null ? mi.classfile : null;
-        if(cf != null) {
-            URI uri = cf.toUri();
-            ClassPath cp = cpinfo.getClassPath(ClasspathInfo.PathKind.BOOT);
-            try {
-                isJDK = cp.findOwnerRoot(URLMapper.findFileObject(uri.toURL())) != null;
-            } catch (MalformedURLException ex) {
-                Exceptions.printStackTrace(ex);
-            }
+        for (FileObject root : cpinfo.getClassPath(ClasspathInfo.PathKind.BOOT).getRoots()) {
+            if (root.getNameExt().contentEquals(me.getQualifiedName()))
+                return true;
         }
-        return isJDK;
+        return false;
     }
     
     Collection<DependencyEdge> collectTransitiveDependencies(Collection<DependencyEdge> deps) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists