diff options
Diffstat (limited to 'src/lombok/eclipse/handlers/HandleSetter.java')
-rw-r--r-- | src/lombok/eclipse/handlers/HandleSetter.java | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/lombok/eclipse/handlers/HandleSetter.java b/src/lombok/eclipse/handlers/HandleSetter.java index c5f87a93..d33594b1 100644 --- a/src/lombok/eclipse/handlers/HandleSetter.java +++ b/src/lombok/eclipse/handlers/HandleSetter.java @@ -23,10 +23,7 @@ import org.eclipse.jdt.internal.compiler.ast.ThisReference; import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.ast.TypeReference; import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; -import org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding; -import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; import org.eclipse.jdt.internal.compiler.lookup.MethodScope; -import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; import org.eclipse.jdt.internal.compiler.lookup.TypeIds; import org.mangosdk.spi.ProviderFor; @@ -72,9 +69,7 @@ public class HandleSetter implements EclipseAnnotationHandler<Setter> { switch ( methodExists(setterName, fieldNode) ) { case EXISTS_BY_LOMBOK: - Node methodNode = getExistingLombokMethod(setterName, fieldNode); - injectScopeIntoSetter(modifier, field, (MethodDeclaration)methodNode.get(), (TypeDeclaration) methodNode.up().get()); - return false; + return true; case EXISTS_BY_USER: if ( whineIfExists ) errorNode.addWarning( String.format("Not generating %s(%s %s): A method with that name already exists", @@ -93,20 +88,6 @@ public class HandleSetter implements EclipseAnnotationHandler<Setter> { return false; } - private void injectScopeIntoSetter(int modifier, FieldDeclaration field, MethodDeclaration method, TypeDeclaration parent) { - if ( parent.scope != null ) { - TypeBinding[] params = new TypeBinding[] { field.type.resolvedType }; - - if ( method.binding == null ) { - method.scope = new MethodScope(parent.scope, method, false); - method.binding = new MethodBinding(modifier, method.selector, BaseTypeBinding.VOID, params, null, parent.binding); - } - method.binding.parameters = params; - method.binding.returnType = BaseTypeBinding.VOID; - method.returnType.resolvedType = BaseTypeBinding.VOID; - } - } - private MethodDeclaration generateSetter(TypeDeclaration parent, FieldDeclaration field, String name, int modifier, ASTNode ast) { long pos = (((long)ast.sourceStart) << 32) | ast.sourceEnd; @@ -122,7 +103,6 @@ public class HandleSetter implements EclipseAnnotationHandler<Setter> { method.typeParameters = null; method.scope = parent.scope == null ? null : new MethodScope(parent.scope, method, false); method.bits |= Eclipse.ECLIPSE_DO_NOT_TOUCH_FLAG; - injectScopeIntoSetter(modifier, field, method, parent); FieldReference thisX = new FieldReference(("this." + new String(field.name)).toCharArray(), pos); thisX.receiver = new ThisReference(ast.sourceStart, ast.sourceEnd); thisX.token = field.name; |