aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/handlers/HandleSetter.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2011-10-24 21:48:43 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2011-10-24 22:02:14 +0200
commitc402dd86379e532895f73ee209c432f84bb5f421 (patch)
treef5d59432ec551caf2b02c88279a9d8890ef5e26b /src/core/lombok/eclipse/handlers/HandleSetter.java
parent335d6e64c66f85110cc8cafbe1155917e821db68 (diff)
downloadlombok-c402dd86379e532895f73ee209c432f84bb5f421.tar.gz
lombok-c402dd86379e532895f73ee209c432f84bb5f421.tar.bz2
lombok-c402dd86379e532895f73ee209c432f84bb5f421.zip
pretty big refactor; introduced a new source package which should be (and is) separately compilable, i.e. has no deps on any of the others.
This is preparation work for being able to access some of these from lombok.ast without creating a cyclic dependency nightmare.
Diffstat (limited to 'src/core/lombok/eclipse/handlers/HandleSetter.java')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleSetter.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleSetter.java b/src/core/lombok/eclipse/handlers/HandleSetter.java
index 5f684410..e3bfe935 100644
--- a/src/core/lombok/eclipse/handlers/HandleSetter.java
+++ b/src/core/lombok/eclipse/handlers/HandleSetter.java
@@ -30,12 +30,10 @@ import java.util.Collection;
import lombok.AccessLevel;
import lombok.Setter;
import lombok.core.AnnotationValues;
+import lombok.core.TransformationsUtil;
import lombok.core.AST.Kind;
-import lombok.core.handlers.TransformationsUtil;
-import lombok.eclipse.Eclipse;
import lombok.eclipse.EclipseAnnotationHandler;
import lombok.eclipse.EclipseNode;
-import lombok.eclipse.handlers.EclipseHandlerUtil.FieldAccess;
import org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.eclipse.jdt.internal.compiler.ast.Annotation;
@@ -84,7 +82,7 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> {
for (EclipseNode field : typeNode.down()) {
if (field.getKind() != Kind.FIELD) continue;
FieldDeclaration fieldDecl = (FieldDeclaration) field.get();
- if (!EclipseHandlerUtil.filterField(fieldDecl)) continue;
+ if (!filterField(fieldDecl)) continue;
//Skip final fields.
if ((fieldDecl.modifiers & ClassFileConstants.AccFinal) != 0) continue;
@@ -181,15 +179,15 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> {
int pS = source.sourceStart, pE = source.sourceEnd;
long p = (long)pS << 32 | pE;
MethodDeclaration method = new MethodDeclaration(parent.compilationResult);
- Eclipse.setGeneratedBy(method, source);
+ setGeneratedBy(method, source);
method.modifiers = modifier;
method.returnType = TypeReference.baseTypeReference(TypeIds.T_void, 0);
method.returnType.sourceStart = pS; method.returnType.sourceEnd = pE;
- Eclipse.setGeneratedBy(method.returnType, source);
+ setGeneratedBy(method.returnType, source);
method.annotations = null;
Argument param = new Argument(field.name, p, copyType(field.type, source), Modifier.FINAL);
param.sourceStart = pS; param.sourceEnd = pE;
- Eclipse.setGeneratedBy(param, source);
+ setGeneratedBy(param, source);
method.arguments = new Argument[] { param };
method.selector = name.toCharArray();
method.binding = null;
@@ -198,10 +196,10 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> {
method.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG;
Expression fieldRef = createFieldAccessor(fieldNode, FieldAccess.ALWAYS_FIELD, source);
NameReference fieldNameRef = new SingleNameReference(field.name, p);
- Eclipse.setGeneratedBy(fieldNameRef, source);
+ setGeneratedBy(fieldNameRef, source);
Assignment assignment = new Assignment(fieldRef, fieldNameRef, (int)p);
assignment.sourceStart = pS; assignment.sourceEnd = pE;
- Eclipse.setGeneratedBy(assignment, source);
+ setGeneratedBy(assignment, source);
method.bodyStart = method.declarationSourceStart = method.sourceStart = source.sourceStart;
method.bodyEnd = method.declarationSourceEnd = method.sourceEnd = source.sourceEnd;