You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/07/28 15:39:20 UTC

svn commit: r1836929 - /commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java

Author: ggregory
Date: Sat Jul 28 15:39:19 2018
New Revision: 1836929

URL: http://svn.apache.org/viewvc?rev=1836929&view=rev
Log:
[BCEL-305] ClassPath.getClassFile() and friends do not work with JRE 9 and higher. Remove old code.

Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java?rev=1836929&r1=1836928&r2=1836929&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java Sat Jul 28 15:39:19 2018
@@ -358,30 +358,6 @@ public class ClassPath implements Closea
 
     private static class JrtModules extends AbstractPathEntry {
 
-        @SuppressWarnings("resource")
-        private static JrtModule[] getJreModules() {
-            final List<JrtModule> list = new ArrayList<>();
-            final Path jrePath = Paths.get(System.getProperty("java.home"));
-            try {
-                final Path jrtFsPath = jrePath.resolve("lib").resolve("jrt-fs.jar");
-                if (Files.exists(jrtFsPath)) {
-                    final Map<String, ?> emptyMap = Collections.emptyMap();
-                    try (URLClassLoader classLoader = new URLClassLoader(new URL[] {jrtFsPath.toUri().toURL() });
-                            FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"), emptyMap, classLoader)) {
-                        try (DirectoryStream<Path> ds = Files.newDirectoryStream(fs.getPath("/modules"))) {
-                            final Iterator<Path> iterator = ds.iterator();
-                            while (iterator.hasNext()) {
-                                list.add(new JrtModule(iterator.next()));
-                            }
-                        }
-                    }
-                }
-            } catch (final Exception e) {
-                // Log?
-                e.printStackTrace();
-            }
-            return list.toArray(new JrtModule[list.size()]);
-        }
         URLClassLoader classLoader;
         FileSystem fs;