diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2011-11-28 10:07:50 -0800 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2011-11-28 10:07:50 -0800 |
commit | eb8af8128d12859e8b3bed7b83d26c2dd20c09f4 (patch) | |
tree | 5b546de7500be39f34fd3aa748c4e7972568d1ca | |
parent | 2cb61b6a89d4bd9988317f47b0eec90c4fbbf0fa (diff) | |
parent | d3b9074f86a297d56966cb5965ae5e5aad603981 (diff) | |
download | lombok-eb8af8128d12859e8b3bed7b83d26c2dd20c09f4.tar.gz lombok-eb8af8128d12859e8b3bed7b83d26c2dd20c09f4.tar.bz2 lombok-eb8af8128d12859e8b3bed7b83d26c2dd20c09f4.zip |
Merge pull request #14 from jvanderhel/Eclipse_getter_errors
Added some more statementEnds to avoid errors in eclipse log
-rw-r--r-- | src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 7 | ||||
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleGetter.java | 19 |
2 files changed, 15 insertions, 11 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index 96dea22d..5130c7de 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -848,7 +848,7 @@ public class EclipseHandlerUtil { MessageSend call = new MessageSend(); setGeneratedBy(call, source); - call.sourceStart = pS; call.sourceEnd = pE; + call.sourceStart = pS; call.statementEnd = call.sourceEnd = pE; call.receiver = new ThisReference(pS, pE); setGeneratedBy(call.receiver, source); call.selector = getter.name; @@ -878,7 +878,7 @@ public class EclipseHandlerUtil { MessageSend call = new MessageSend(); setGeneratedBy(call, source); - call.sourceStart = pS; call.sourceEnd = pE; + call.sourceStart = pS; call.statementEnd = call.sourceEnd = pE; call.receiver = new SingleNameReference(receiver, p); setGeneratedBy(call.receiver, source); call.selector = getter.name; @@ -1136,7 +1136,7 @@ public class EclipseHandlerUtil { NullLiteral nullLiteral = new NullLiteral(pS, pE); setGeneratedBy(nullLiteral, source); EqualExpression equalExpression = new EqualExpression(varName, nullLiteral, OperatorIds.EQUAL_EQUAL); - equalExpression.sourceStart = pS; equalExpression.sourceEnd = pE; + equalExpression.sourceStart = pS; equalExpression.statementEnd = equalExpression.sourceEnd = pE; setGeneratedBy(equalExpression, source); IfStatement ifStatement = new IfStatement(equalExpression, throwStatement, 0, 0); setGeneratedBy(ifStatement, source); @@ -1226,6 +1226,7 @@ public class EclipseHandlerUtil { result.sourceStart = source.sourceStart; result.sourceEnd = source.sourceEnd; + result.statementEnd = source.sourceEnd; setGeneratedBy(result, source); return result; diff --git a/src/core/lombok/eclipse/handlers/HandleGetter.java b/src/core/lombok/eclipse/handlers/HandleGetter.java index fa66d1aa..1d59afb4 100644 --- a/src/core/lombok/eclipse/handlers/HandleGetter.java +++ b/src/core/lombok/eclipse/handlers/HandleGetter.java @@ -305,12 +305,12 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> { TypeReference[][] typeParams = AR_PARAMS.clone(); typeParams[4] = new TypeReference[] {copyType(componentType, source)}; valueDecl.type = new ParameterizedQualifiedTypeReference(AR, typeParams, 0, poss(source, 5)); - valueDecl.type.sourceStart = pS; valueDecl.type.sourceEnd = pE; + valueDecl.type.sourceStart = pS; valueDecl.type.sourceEnd = valueDecl.type.statementEnd = pE; setGeneratedBy(valueDecl.type, source); MessageSend getter = new MessageSend(); setGeneratedBy(getter, source); - getter.sourceStart = pS; getter.sourceEnd = pE; + getter.sourceStart = pS; getter.statementEnd = getter.sourceEnd = pE; getter.selector = new char[] {'g', 'e', 't'}; getter.receiver = createFieldAccessor(fieldNode, FieldAccess.ALWAYS_FIELD, source); @@ -345,10 +345,11 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> { /* value = this.fieldName.get(); */ { MessageSend getter = new MessageSend(); setGeneratedBy(getter, source); - getter.sourceStart = pS; getter.sourceEnd = pE; + getter.sourceStart = pS; getter.sourceEnd = getter.statementEnd = pE; getter.selector = new char[] {'g', 'e', 't'}; getter.receiver = createFieldAccessor(fieldNode, FieldAccess.ALWAYS_FIELD, source); Assignment assign = new Assignment(new SingleNameReference(valueName, p), getter, pE); + assign.sourceStart = pS; assign.statementEnd = assign.sourceEnd = pE; setGeneratedBy(assign, source); setGeneratedBy(assign.lhs, source); inner.statements[0] = assign; @@ -366,14 +367,16 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> { /*value = new java.util.concurrent.atomic.AtomicReference<ValueType>(new ValueType()); */ { AllocationExpression create = new AllocationExpression(); setGeneratedBy(create, source); - create.sourceStart = pS; create.sourceEnd = pE; + create.sourceStart = pS; create.sourceEnd = create.statementEnd = pE; TypeReference[][] typeParams = AR_PARAMS.clone(); typeParams[4] = new TypeReference[] {copyType(componentType, source)}; create.type = new ParameterizedQualifiedTypeReference(AR, typeParams, 0, poss(source, 5)); - create.type.sourceStart = pS; create.type.sourceEnd = pE; + create.type.sourceStart = pS; create.type.sourceEnd = create.type.statementEnd = pE; setGeneratedBy(create.type, source); create.arguments = new Expression[] {field.initialization}; Assignment innerAssign = new Assignment(new SingleNameReference(valueName, p), create, pE); + innerAssign.sourceStart = pS; innerAssign.statementEnd = innerAssign.sourceEnd = pE; + setGeneratedBy(innerAssign, source); setGeneratedBy(innerAssign.lhs, source); innerThen.statements[0] = innerAssign; @@ -382,7 +385,7 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> { /*this.fieldName.set(value);*/ { MessageSend setter = new MessageSend(); setGeneratedBy(setter, source); - setter.sourceStart = pS; setter.sourceEnd = pE; + setter.sourceStart = pS; setter.sourceEnd = setter.statementEnd = pE; setter.receiver = createFieldAccessor(fieldNode, FieldAccess.ALWAYS_FIELD, source); setter.selector = new char[] { 's', 'e', 't' }; setter.arguments = new Expression[] { @@ -408,7 +411,7 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> { /* return value.get(); */ { MessageSend getter = new MessageSend(); setGeneratedBy(getter, source); - getter.sourceStart = pS; getter.sourceEnd = pE; + getter.sourceStart = pS; getter.sourceEnd = getter.statementEnd = pE; getter.selector = new char[] {'g', 'e', 't'}; getter.receiver = new SingleNameReference(valueName, p); setGeneratedBy(getter.receiver, source); @@ -435,7 +438,7 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> { field.type = type; AllocationExpression init = new AllocationExpression(); // Some magic here - init.sourceStart = field.initialization.sourceStart; init.sourceEnd = field.initialization.sourceEnd; + init.sourceStart = field.initialization.sourceStart; init.sourceEnd = init.statementEnd = field.initialization.sourceEnd; init.type = copyType(type, source); field.initialization = init; } |