]> source.dussan.org Git - aspectj.git/commitdiff
Fix Testcase
authorLars Grefer <eclipse@larsgrefer.de>
Thu, 13 Aug 2020 01:32:01 +0000 (03:32 +0200)
committerLars Grefer <eclipse@larsgrefer.de>
Thu, 13 Aug 2020 01:32:01 +0000 (03:32 +0200)
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
weaver/src/test/java/org/aspectj/weaver/bcel/ClasspathManagerTestCase.java

index f4f84f16813a97700a7e6ccfd65ae15f7eba25b7..0cf4cc8caa60174b26e99f1b8e6dd42a0c7010fd 100644 (file)
@@ -44,12 +44,14 @@ public class ClasspathManagerTestCase extends TestCase {
        
        private static String findJvm(String pattern, String jar) {
                String start = System.getProperty("user.home")+"/jvms";
-               for (File f: new File(start).listFiles()) {
-                       if (f.isDirectory() && Pattern.matches(pattern, f.getName())) {
-                               File result = walk(f, jar);
-                               if (result !=null) {
-                                       System.out.println("For "+pattern+" found "+result.getAbsolutePath());
-                                       return result.getAbsolutePath();
+               if (new File(start).isDirectory()) {
+                       for (File f : new File(start).listFiles()) {
+                               if (f.isDirectory() && Pattern.matches(pattern, f.getName())) {
+                                       File result = walk(f, jar);
+                                       if (result != null) {
+                                               System.out.println("For " + pattern + " found " + result.getAbsolutePath());
+                                               return result.getAbsolutePath();
+                                       }
                                }
                        }
                }