aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/eclipse
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-08-27 22:19:29 +0200
committerReinier Zwitserloot <reinier@tipit.to>2009-08-27 22:19:29 +0200
commit7c786f5af61185983940cad794fe2cb50d426005 (patch)
treed43e9ab3629cc4944f05780f82126bad11d96ff5 /src/lombok/eclipse
parent8aab4e60d62eaad04f5df8fb78621d53d12da2db (diff)
downloadlombok-7c786f5af61185983940cad794fe2cb50d426005.tar.gz
lombok-7c786f5af61185983940cad794fe2cb50d426005.tar.bz2
lombok-7c786f5af61185983940cad794fe2cb50d426005.zip
Made all parameters of all generated methods 'final'.
Diffstat (limited to 'src/lombok/eclipse')
-rw-r--r--src/lombok/eclipse/handlers/HandleData.java4
-rw-r--r--src/lombok/eclipse/handlers/HandleEqualsAndHashCode.java4
-rw-r--r--src/lombok/eclipse/handlers/HandleSetter.java5
3 files changed, 8 insertions, 5 deletions
diff --git a/src/lombok/eclipse/handlers/HandleData.java b/src/lombok/eclipse/handlers/HandleData.java
index f1623e39..b598313b 100644
--- a/src/lombok/eclipse/handlers/HandleData.java
+++ b/src/lombok/eclipse/handlers/HandleData.java
@@ -147,7 +147,7 @@ public class HandleData implements EclipseAnnotationHandler<Data> {
thisX.token = field.name;
assigns.add(new Assignment(thisX, new SingleNameReference(field.name, p), (int)p));
long fieldPos = (((long)field.sourceStart) << 32) | field.sourceEnd;
- args.add(new Argument(field.name, fieldPos, copyType(field.type), 0));
+ args.add(new Argument(field.name, fieldPos, copyType(field.type), Modifier.FINAL));
}
constructor.statements = assigns.isEmpty() ? null : assigns.toArray(new Statement[assigns.size()]);
@@ -188,7 +188,7 @@ public class HandleData implements EclipseAnnotationHandler<Data> {
FieldDeclaration field = (FieldDeclaration) fieldNode.get();
long fieldPos = (((long)field.sourceStart) << 32) | field.sourceEnd;
assigns.add(new SingleNameReference(field.name, fieldPos));
- args.add(new Argument(field.name, fieldPos, copyType(field.type), 0));
+ args.add(new Argument(field.name, fieldPos, copyType(field.type), Modifier.FINAL));
}
statement.arguments = assigns.isEmpty() ? null : assigns.toArray(new Expression[assigns.size()]);
diff --git a/src/lombok/eclipse/handlers/HandleEqualsAndHashCode.java b/src/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
index c94fde76..b8916d46 100644
--- a/src/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
+++ b/src/lombok/eclipse/handlers/HandleEqualsAndHashCode.java
@@ -244,7 +244,7 @@ public class HandleEqualsAndHashCode implements EclipseAnnotationHandler<EqualsA
/* Without fields, PRIME isn't used, and that would trigger a 'local variable not used' warning. */
if ( !isEmpty || callSuper ) {
LocalDeclaration primeDecl = new LocalDeclaration(PRIME, 0 ,0);
- primeDecl.modifiers = Modifier.FINAL;
+ primeDecl.modifiers |= Modifier.FINAL;
primeDecl.type = TypeReference.baseTypeReference(TypeIds.T_int, 0);
primeDecl.initialization = new IntLiteral("31".toCharArray(), 0, 0);
statements.add(primeDecl);
@@ -364,7 +364,7 @@ public class HandleEqualsAndHashCode implements EclipseAnnotationHandler<EqualsA
method.bodyEnd = method.declarationSourceEnd = method.sourceEnd = pos.sourceEnd;
method.arguments = new Argument[] {
new Argument(new char[] { 'o' }, 0,
- new QualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT, new long[] { 0, 0, 0 }), 0)
+ new QualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT, new long[] { 0, 0, 0 }), Modifier.FINAL)
};
List<Statement> statements = new ArrayList<Statement>();
diff --git a/src/lombok/eclipse/handlers/HandleSetter.java b/src/lombok/eclipse/handlers/HandleSetter.java
index adac30d7..1e301c29 100644
--- a/src/lombok/eclipse/handlers/HandleSetter.java
+++ b/src/lombok/eclipse/handlers/HandleSetter.java
@@ -22,6 +22,9 @@
package lombok.eclipse.handlers;
import static lombok.eclipse.handlers.PKG.*;
+
+import java.lang.reflect.Modifier;
+
import lombok.AccessLevel;
import lombok.Setter;
import lombok.core.AnnotationValues;
@@ -124,7 +127,7 @@ public class HandleSetter implements EclipseAnnotationHandler<Setter> {
method.modifiers = modifier;
method.returnType = TypeReference.baseTypeReference(TypeIds.T_void, 0);
method.annotations = null;
- Argument param = new Argument(field.name, pos, Eclipse.copyType(field.type), 0);
+ Argument param = new Argument(field.name, pos, Eclipse.copyType(field.type), Modifier.FINAL);
method.arguments = new Argument[] { param };
method.selector = name.toCharArray();
method.binding = null;