aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/eclipse/handlers/HandleGetter.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-06-23 08:04:44 +0200
committerReinier Zwitserloot <reinier@tipit.to>2009-06-23 08:04:44 +0200
commit8bbdcec6fad6edf8f335f9e0c6899fddc56e07c1 (patch)
tree2f9c6d2c92f0723454eb8486e1a18dd178d0e885 /src/lombok/eclipse/handlers/HandleGetter.java
parent6c82a3c780539825157f721fcfe1a8894e73b161 (diff)
downloadlombok-8bbdcec6fad6edf8f335f9e0c6899fddc56e07c1.tar.gz
lombok-8bbdcec6fad6edf8f335f9e0c6899fddc56e07c1.tar.bz2
lombok-8bbdcec6fad6edf8f335f9e0c6899fddc56e07c1.zip
Figured out that our previous act of just assigning TypeReference objects directly to other nodes (e.g. from a FieldDeclaration's type to a method argument) is NOT a good idea, as this screws up when
the TypeReference object represents a generic type (like 'T') - each instance of a generic type has a different resolution, but 1 TypeReference object can only hold 1 resolution. Thus, a copyType() method has been written, and the Handle* classes have been updated to use it. Also, generateEquals() is half-finished in HandleData.
Diffstat (limited to 'src/lombok/eclipse/handlers/HandleGetter.java')
-rw-r--r--src/lombok/eclipse/handlers/HandleGetter.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lombok/eclipse/handlers/HandleGetter.java b/src/lombok/eclipse/handlers/HandleGetter.java
index d0ec673d..b0353a34 100644
--- a/src/lombok/eclipse/handlers/HandleGetter.java
+++ b/src/lombok/eclipse/handlers/HandleGetter.java
@@ -59,7 +59,7 @@ public class HandleGetter implements EclipseAnnotationHandler<Getter> {
}
FieldDeclaration field = (FieldDeclaration) fieldNode.get();
- TypeReference fieldType = field.type;
+ TypeReference fieldType = Eclipse.copyType(field.type);
String getterName = TransformationsUtil.toGetterName(
new String(field.name), nameEquals(fieldType.getTypeName(), "boolean"));
@@ -89,7 +89,7 @@ public class HandleGetter implements EclipseAnnotationHandler<Getter> {
int modifier, ASTNode pos) {
MethodDeclaration method = new MethodDeclaration(parent.compilationResult);
method.modifiers = modifier;
- method.returnType = field.type;
+ method.returnType = Eclipse.copyType(field.type);
method.annotations = null;
method.arguments = null;
method.selector = name.toCharArray();