diff options
author | jvanderhel <Jappe.vanderhel@gmail.com> | 2011-11-22 19:42:31 +0100 |
---|---|---|
committer | jvanderhel <Jappe.vanderhel@gmail.com> | 2011-11-22 19:49:01 +0100 |
commit | d3b9074f86a297d56966cb5965ae5e5aad603981 (patch) | |
tree | c54365907ae15b71a46777ae550a44dd7c75b03f /src/core/lombok/eclipse/handlers/HandleGetter.java | |
parent | ef820d8d5ab76c6db8335201da3c7ab9de7cb56a (diff) | |
download | lombok-d3b9074f86a297d56966cb5965ae5e5aad603981.tar.gz lombok-d3b9074f86a297d56966cb5965ae5e5aad603981.tar.bz2 lombok-d3b9074f86a297d56966cb5965ae5e5aad603981.zip |
Added some more statementEnds to avoid errors in eclipse log
Diffstat (limited to 'src/core/lombok/eclipse/handlers/HandleGetter.java')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleGetter.java | 19 |
1 files changed, 11 insertions, 8 deletions
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; } |