From 56602322d9c44b69017b345aaca5b3807fd5d427 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sun, 8 Nov 2009 14:52:32 +0100 Subject: Minor bug fixes and style edits. All these were found after running findbugs on the lombok sources. --- src/lombok/installer/EclipseLocation.java | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/lombok/installer') diff --git a/src/lombok/installer/EclipseLocation.java b/src/lombok/installer/EclipseLocation.java index 1a04900b..e925f158 100644 --- a/src/lombok/installer/EclipseLocation.java +++ b/src/lombok/installer/EclipseLocation.java @@ -63,7 +63,7 @@ final class EclipseLocation { * Thrown when creating a new EclipseLocation with a path object that doesn't, in fact, * point at an Eclipse installation. */ - final class NotAnEclipseException extends Exception { + static final class NotAnEclipseException extends Exception { private static final long serialVersionUID = 1L; public NotAnEclipseException(String message, Throwable cause) { @@ -177,7 +177,7 @@ final class EclipseLocation { } /** Thrown when uninstalling lombok fails. */ - class UninstallException extends Exception { + static class UninstallException extends Exception { private static final long serialVersionUID = 1L; public UninstallException(String message, Throwable cause) { @@ -260,7 +260,7 @@ final class EclipseLocation { } /** Thrown when installing lombok fails. */ - class InstallException extends Exception { + static class InstallException extends Exception { private static final long serialVersionUID = 1L; public InstallException(String message, Throwable cause) { @@ -318,13 +318,17 @@ final class EclipseLocation { boolean readSucceeded = false; try { FileOutputStream out = new FileOutputStream(lombokJar); - InputStream in = new FileInputStream(ourJar); try { - while (true) { - int r = in.read(b); - if (r == -1) break; - if (r > 0) readSucceeded = true; - out.write(b, 0, r); + InputStream in = new FileInputStream(ourJar); + try { + while (true) { + int r = in.read(b); + if (r == -1) break; + if (r > 0) readSucceeded = true; + out.write(b, 0, r); + } + } finally { + in.close(); } } finally { out.close(); -- cgit