diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2009-12-30 03:25:57 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2009-12-30 03:25:57 +0100 |
commit | 87044b0bc58b7084c3e207794fde14ed75ff18bc (patch) | |
tree | 0fea307bab599c98c68d6bae28fe916891d35f4c /src | |
parent | cf11641c8a5973b181f779c6fe20b9d81a7f866a (diff) | |
download | lombok-87044b0bc58b7084c3e207794fde14ed75ff18bc.tar.gz lombok-87044b0bc58b7084c3e207794fde14ed75ff18bc.tar.bz2 lombok-87044b0bc58b7084c3e207794fde14ed75ff18bc.zip |
Fix for the installer crashing with NPE on line 589.
Diffstat (limited to 'src')
-rw-r--r-- | src/installer/lombok/installer/eclipse/EclipseFinder.java | 12 | ||||
-rw-r--r-- | src/installer/lombok/installer/netbeans/NetbeansFinder.java | 15 |
2 files changed, 18 insertions, 9 deletions
diff --git a/src/installer/lombok/installer/eclipse/EclipseFinder.java b/src/installer/lombok/installer/eclipse/EclipseFinder.java index d520b1c4..4aac1b54 100644 --- a/src/installer/lombok/installer/eclipse/EclipseFinder.java +++ b/src/installer/lombok/installer/eclipse/EclipseFinder.java @@ -103,7 +103,8 @@ public class EclipseFinder extends IdeFinder { String eclipseLocation = findEclipseOnWindows1(dir); if (eclipseLocation != null) { try { - locations.add(createLocation(eclipseLocation)); + IdeLocation newLocation = createLocation(eclipseLocation); + if (newLocation != null) locations.add(newLocation); } catch (CorruptedIdeLocationException e) { problems.add(e); } @@ -172,7 +173,8 @@ public class EclipseFinder extends IdeFinder { for (String guess : guesses) { try { - locations.add(createLocation(guess)); + IdeLocation newLocation = createLocation(guess); + if (newLocation != null) locations.add(newLocation); } catch (CorruptedIdeLocationException e) { problems.add(e); } @@ -206,7 +208,8 @@ public class EclipseFinder extends IdeFinder { if (!f.isDirectory()) return; if (f.getName().toLowerCase().equals(getMacExecutableName().toLowerCase())) { try { - locations.add(createLocation(f.getParent())); + IdeLocation newLocation = createLocation(f.getParent()); + if (newLocation != null) locations.add(newLocation); } catch (CorruptedIdeLocationException e) { problems.add(e); } @@ -214,7 +217,8 @@ public class EclipseFinder extends IdeFinder { if (f.getName().toLowerCase().contains(getDirName())) { if (new File(f, getMacExecutableName()).exists()) { try { - locations.add(createLocation(f.toString())); + IdeLocation newLocation = createLocation(f.toString()); + if (newLocation != null) locations.add(newLocation); } catch (CorruptedIdeLocationException e) { problems.add(e); } diff --git a/src/installer/lombok/installer/netbeans/NetbeansFinder.java b/src/installer/lombok/installer/netbeans/NetbeansFinder.java index 16dbf251..28cdffac 100644 --- a/src/installer/lombok/installer/netbeans/NetbeansFinder.java +++ b/src/installer/lombok/installer/netbeans/NetbeansFinder.java @@ -69,7 +69,8 @@ public class NetbeansFinder extends IdeFinder { String netbeansLocation = findNetbeansOnWindows1(dir); if (netbeansLocation != null) { try { - locations.add(NetbeansLocationProvider.create0(netbeansLocation)); + IdeLocation newLocation = NetbeansLocationProvider.create0(netbeansLocation); + if (newLocation != null) locations.add(newLocation); } catch (CorruptedIdeLocationException e) { problems.add(e); } @@ -85,7 +86,8 @@ public class NetbeansFinder extends IdeFinder { String netbeansLocation = findNetbeansOnWindows1(dir2); if (netbeansLocation != null) { try { - locations.add(NetbeansLocationProvider.create0(netbeansLocation)); + IdeLocation newLocation = NetbeansLocationProvider.create0(netbeansLocation); + if (newLocation != null) locations.add(newLocation); } catch (CorruptedIdeLocationException e) { problems.add(e); } @@ -153,7 +155,8 @@ public class NetbeansFinder extends IdeFinder { for (String guess : guesses) { try { - locations.add(NetbeansLocationProvider.create0(guess)); + IdeLocation newLocation = NetbeansLocationProvider.create0(guess); + if (newLocation != null) locations.add(newLocation); } catch (CorruptedIdeLocationException e) { problems.add(e); } @@ -179,7 +182,8 @@ public class NetbeansFinder extends IdeFinder { if (!dir.isDirectory()) continue; if (dir.getName().toLowerCase().startsWith("netbeans") && dir.getName().toLowerCase().endsWith(".app")) { try { - locations.add(NetbeansLocationProvider.create0(dir.getAbsolutePath())); + IdeLocation newLocation = NetbeansLocationProvider.create0(dir.getAbsolutePath()); + if (newLocation != null) locations.add(newLocation); } catch (CorruptedIdeLocationException e) { problems.add(e); } @@ -189,7 +193,8 @@ public class NetbeansFinder extends IdeFinder { if (!dir2.isDirectory()) continue; if (dir2.getName().toLowerCase().startsWith("netbeans") && dir2.getName().toLowerCase().endsWith(".app")) { try { - locations.add(NetbeansLocationProvider.create0(dir2.getAbsolutePath())); + IdeLocation newLocation = NetbeansLocationProvider.create0(dir2.getAbsolutePath()); + if (newLocation != null) locations.add(newLocation); } catch (CorruptedIdeLocationException e) { problems.add(e); } |