diff options
author | Roel Spilker <r.spilker@gmail.com> | 2014-02-05 00:50:32 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2014-02-05 00:50:32 +0100 |
commit | 83efe294663fd173410b29a80578f54e84b55e03 (patch) | |
tree | 737ef8ea0689ba73dacf17f38cbc33cfea408085 /src/core/lombok/eclipse | |
parent | 5782b909c5c0e8f766de36d600bc314eaa98e6b2 (diff) | |
download | lombok-83efe294663fd173410b29a80578f54e84b55e03.tar.gz lombok-83efe294663fd173410b29a80578f54e84b55e03.tar.bz2 lombok-83efe294663fd173410b29a80578f54e84b55e03.zip |
Fix for issue 631. Martin, thanks for the contribution.
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r-- | src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index a40cb0c8..b703dd68 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -435,21 +435,21 @@ public class EclipseHandlerUtil { } } } - TypeReference typeRef = new ParameterizedQualifiedTypeReference(iRef.tokens, args, iRef.dimensions(), iRef.sourcePositions); + TypeReference typeRef = new ParameterizedQualifiedTypeReference(iRef.tokens, args, iRef.dimensions(), copy(iRef.sourcePositions)); setGeneratedBy(typeRef, source); return typeRef; } if (ref instanceof ArrayQualifiedTypeReference) { ArrayQualifiedTypeReference iRef = (ArrayQualifiedTypeReference) ref; - TypeReference typeRef = new ArrayQualifiedTypeReference(iRef.tokens, iRef.dimensions(), iRef.sourcePositions); + TypeReference typeRef = new ArrayQualifiedTypeReference(iRef.tokens, iRef.dimensions(), copy(iRef.sourcePositions)); setGeneratedBy(typeRef, source); return typeRef; } if (ref instanceof QualifiedTypeReference) { QualifiedTypeReference iRef = (QualifiedTypeReference) ref; - TypeReference typeRef = new QualifiedTypeReference(iRef.tokens, iRef.sourcePositions); + TypeReference typeRef = new QualifiedTypeReference(iRef.tokens, copy(iRef.sourcePositions)); setGeneratedBy(typeRef, source); return typeRef; } @@ -1519,7 +1519,7 @@ public class EclipseHandlerUtil { } else if (castTo.getClass() == QualifiedTypeReference.class) { QualifiedTypeReference qtr = (QualifiedTypeReference) castTo; //Same here, but for the more complex types, they stay types. - castToConverted = new QualifiedNameReference(qtr.tokens, qtr.sourcePositions, qtr.sourceStart, qtr.sourceEnd); + castToConverted = new QualifiedNameReference(qtr.tokens, copy(qtr.sourcePositions), qtr.sourceStart, qtr.sourceEnd); castToConverted.bits = (castToConverted.bits & ~Binding.VARIABLE) | Binding.TYPE; setGeneratedBy(castToConverted, source); } @@ -1718,4 +1718,8 @@ public class EclipseHandlerUtil { setGeneratedBy(nameReference, source); return nameReference; } + + private static long[] copy(long[] array) { + return array == null ? null : array.clone(); + } } |