diff options
-rw-r--r-- | src/lombok/eclipse/handlers/EclipseHandlerUtil.java | 2 | ||||
-rw-r--r-- | src/lombok/eclipse/handlers/HandleGetter.java | 2 | ||||
-rw-r--r-- | src/lombok/installer/EclipseLocation.java | 22 | ||||
-rw-r--r-- | src/lombok/javac/handlers/HandleSynchronized.java | 2 |
4 files changed, 16 insertions, 12 deletions
diff --git a/src/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/lombok/eclipse/handlers/EclipseHandlerUtil.java index 88559436..2f676d09 100644 --- a/src/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -348,7 +348,7 @@ public class EclipseHandlerUtil { * Create an annotation of the given name, and is marked as being generated by the given source. */ public static MarkerAnnotation makeMarkerAnnotation(char[][] name, ASTNode source) { - long pos = source.sourceStart << 32 | source.sourceEnd; + long pos = (long)source.sourceStart << 32 | source.sourceEnd; TypeReference typeRef = new QualifiedTypeReference(name, new long[] {pos, pos, pos}); Eclipse.setGeneratedBy(typeRef, source); MarkerAnnotation ann = new MarkerAnnotation(typeRef, (int)(pos >> 32)); diff --git a/src/lombok/eclipse/handlers/HandleGetter.java b/src/lombok/eclipse/handlers/HandleGetter.java index 7bff701e..4a9930e3 100644 --- a/src/lombok/eclipse/handlers/HandleGetter.java +++ b/src/lombok/eclipse/handlers/HandleGetter.java @@ -142,7 +142,7 @@ public class HandleGetter implements EclipseAnnotationHandler<Getter> { method.thrownExceptions = null; method.typeParameters = null; method.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; - Expression fieldExpression = new SingleNameReference(field.name, (field.declarationSourceStart << 32) | field.declarationSourceEnd); + Expression fieldExpression = new SingleNameReference(field.name, ((long)field.declarationSourceStart << 32) | field.declarationSourceEnd); Eclipse.setGeneratedBy(fieldExpression, source); Statement returnStatement = new ReturnStatement(fieldExpression, field.sourceStart, field.sourceEnd); Eclipse.setGeneratedBy(returnStatement, source); 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(); diff --git a/src/lombok/javac/handlers/HandleSynchronized.java b/src/lombok/javac/handlers/HandleSynchronized.java index b607ea72..c86d99c6 100644 --- a/src/lombok/javac/handlers/HandleSynchronized.java +++ b/src/lombok/javac/handlers/HandleSynchronized.java @@ -76,7 +76,7 @@ public class HandleSynchronized implements JavacAnnotationHandler<Synchronized> if (fieldExists(lockName, methodNode) == MemberExistsResult.NOT_EXISTS) { if (!autoMake) { - annotationNode.addError("The field " + new String(lockName) + " does not exist."); + annotationNode.addError("The field " + lockName + " does not exist."); return true; } JCExpression objectType = chainDots(maker, methodNode, "java", "lang", "Object"); |