From ad4bd36274d2bfe8dcf74977d921a114739386b1 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 13 Feb 2017 21:47:48 +0100 Subject: Now searches through any subdir of any dir containing the string ‘eclipse’ (or STS or whatnot), to any depth, instead of requiring each subdir to be searched to again contain ‘eclipse’ or some variant thereof. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mac installer installs to /Applications/eclipse/java-neon, for example, by default, so it wasn’t being found. --- .../lombok/installer/eclipse/EclipseProductLocationProvider.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/installer/lombok/installer/eclipse/EclipseProductLocationProvider.java b/src/installer/lombok/installer/eclipse/EclipseProductLocationProvider.java index 3710d7d9..b807f02b 100644 --- a/src/installer/lombok/installer/eclipse/EclipseProductLocationProvider.java +++ b/src/installer/lombok/installer/eclipse/EclipseProductLocationProvider.java @@ -288,10 +288,10 @@ public class EclipseProductLocationProvider implements IdeLocationProvider { abstract String findEclipseOnPlatform(File dir); void recurseDirectory(List locations, List problems, File dir) { - recurseDirectory0(locations, problems, dir, 0); + recurseDirectory0(locations, problems, dir, 0, false); } - private void recurseDirectory0(List locations, List problems, File f, int loopCounter) { + private void recurseDirectory0(List locations, List problems, File f, int loopCounter, boolean nameFound) { //Various try/catch/ignore statements are in this for loop. Weird conditions on the disk can cause exceptions, //such as an unformatted drive causing a NullPointerException on listFiles. Best action is almost invariably to just //continue onwards. @@ -301,9 +301,9 @@ public class EclipseProductLocationProvider implements IdeLocationProvider { for (File dir : listFiles) { if (!dir.isDirectory()) continue; try { - if (dir.getName().toLowerCase().contains(descriptor.getDirectoryName())) { + if (nameFound || dir.getName().toLowerCase().contains(descriptor.getDirectoryName())) { findEclipse(locations, problems, dir); - if (loopCounter < 50) recurseDirectory0(locations, problems, dir, loopCounter + 1); + if (loopCounter < 50) recurseDirectory0(locations, problems, dir, loopCounter + 1, true); } } catch (Exception ignore) {} } -- cgit