aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2017-02-13 21:47:48 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2017-02-13 21:47:48 +0100
commitad4bd36274d2bfe8dcf74977d921a114739386b1 (patch)
tree17310b46eb37f3b654861c31b9fda8ba323dfdda
parent9491bce6021d22c98dd615821d5dbb9fdf5e3fc5 (diff)
downloadlombok-ad4bd36274d2bfe8dcf74977d921a114739386b1.tar.gz
lombok-ad4bd36274d2bfe8dcf74977d921a114739386b1.tar.bz2
lombok-ad4bd36274d2bfe8dcf74977d921a114739386b1.zip
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.
The mac installer installs to /Applications/eclipse/java-neon, for example, by default, so it wasn’t being found.
-rw-r--r--src/installer/lombok/installer/eclipse/EclipseProductLocationProvider.java8
1 files 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<IdeLocation> locations, List<CorruptedIdeLocationException> problems, File dir) {
- recurseDirectory0(locations, problems, dir, 0);
+ recurseDirectory0(locations, problems, dir, 0, false);
}
- private void recurseDirectory0(List<IdeLocation> locations, List<CorruptedIdeLocationException> problems, File f, int loopCounter) {
+ private void recurseDirectory0(List<IdeLocation> locations, List<CorruptedIdeLocationException> 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) {}
}