diff --git a/headless-services/commons/commons-java/src/main/java/org/springframework/ide/vscode/commons/java/BootProjectUtil.java b/headless-services/commons/commons-java/src/main/java/org/springframework/ide/vscode/commons/java/BootProjectUtil.java index 89494a4d6..23e590bb0 100644 --- a/headless-services/commons/commons-java/src/main/java/org/springframework/ide/vscode/commons/java/BootProjectUtil.java +++ b/headless-services/commons/commons-java/src/main/java/org/springframework/ide/vscode/commons/java/BootProjectUtil.java @@ -11,7 +11,6 @@ package org.springframework.ide.vscode.commons.java; import java.io.File; -import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -42,21 +41,10 @@ public class BootProjectUtil { public static Path javaHomeFromLibJar(Path libJar) { for (Path home = libJar; home.getParent() != null; home = home.getParent()) { - System.out.println("Trying Java home folder: " + home); - if (Files.isDirectory(home)) { - System.out.println("Folder contents: "); - try { - Files.list(home).forEach(System.out::println); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } Path bin = home.resolve("bin"); Path lib = home.resolve("lib"); Path include = home.resolve("include"); Path man = home.resolve("man"); - if (Files.isDirectory(bin) && Files.isDirectory(lib) && Files.isDirectory(include) && Files.isDirectory(man)) { return home; } @@ -69,10 +57,12 @@ public class BootProjectUtil { if (home != null) { Path sources = home.resolve("src.zip"); if (Files.exists(sources)) { + System.out.println("Found " + sources); return sources; } sources = home.resolve("lib/src.zip"); if (Files.exists(sources)) { + System.out.println("Found " + sources); return sources; } } diff --git a/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/JavaIndexTest.java b/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/JavaIndexTest.java index c17b2207f..0af3dffe5 100644 --- a/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/JavaIndexTest.java +++ b/headless-services/commons/commons-maven/src/test/java/org/springframework/ide/vscode/commons/maven/JavaIndexTest.java @@ -67,6 +67,9 @@ public class JavaIndexTest { .collectSortedList((o1, o2) -> o2.getT2().compareTo(o1.getT2())) .block(); assertTrue(results.size() > 10); + results.forEach(res -> { + System.out.println("Found type: " + res.getT1()); + }); IType type = results.get(0).getT1(); System.out.println(type.getFullyQualifiedName() + ": " + type.getBindingKey()); assertEquals("java.util.Map", type.getFullyQualifiedName()); @@ -80,6 +83,9 @@ public class JavaIndexTest { .collectSortedList((o1, o2) -> o2.getT2().compareTo(o1.getT2())) .block(); assertTrue(results.size() > 10); + results.forEach(res -> { + System.out.println("Found type: " + res.getT1()); + }); IType type = results.get(0).getT1(); System.out.println(type.getFullyQualifiedName() + ": " + type.getBindingKey()); assertEquals("java.util.EnumMap$KeySet", type.getFullyQualifiedName()); @@ -93,6 +99,9 @@ public class JavaIndexTest { .collectSortedList((o1, o2) -> o2.getT2().compareTo(o1.getT2())) .block(); assertTrue(results.size() > 10); + results.forEach(res -> { + System.out.println("Found result: " + res.getT1()); + }); assertEquals("java.util", results.get(0).getT1()); }