diff options
author | Roel Spilker <r.spilker@gmail.com> | 2010-11-11 05:54:42 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2010-11-11 05:54:42 +0100 |
commit | a9113718ae2adc2d837f9e5a1adf885a4b1aa844 (patch) | |
tree | c2d38069fb44f3d1ed19ffe4716a6cdc21fdf66b /src | |
parent | ddf54dcfaea71e50ae32b45785b8624b9137843b (diff) | |
download | lombok-a9113718ae2adc2d837f9e5a1adf885a4b1aa844.tar.gz lombok-a9113718ae2adc2d837f9e5a1adf885a4b1aa844.tar.bz2 lombok-a9113718ae2adc2d837f9e5a1adf885a4b1aa844.zip |
Set generated on all created ASTNodes
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lombok/eclipse/Eclipse.java | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/src/core/lombok/eclipse/Eclipse.java b/src/core/lombok/eclipse/Eclipse.java index 8354215b..8778b22b 100644 --- a/src/core/lombok/eclipse/Eclipse.java +++ b/src/core/lombok/eclipse/Eclipse.java @@ -352,16 +352,24 @@ public class Eclipse { if (base != null) { if (dims > 0) { - return new ArrayTypeReference(base, dims, pos(pos)); + TypeReference result = new ArrayTypeReference(base, dims, pos(pos)); + Eclipse.setGeneratedBy(result, pos); + return result; } - return new SingleTypeReference(base, pos(pos)); + TypeReference result = new SingleTypeReference(base, pos(pos)); + Eclipse.setGeneratedBy(result, pos); + return result; } if (binding.isAnonymousType()) { ReferenceBinding ref = (ReferenceBinding)binding; ReferenceBinding[] supers = ref.superInterfaces(); if (supers == null || supers.length == 0) supers = new ReferenceBinding[] {ref.superclass()}; - if (supers[0] == null) return new QualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT, poss(pos, 3)); + if (supers[0] == null) { + TypeReference result = new QualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT, poss(pos, 3)); + Eclipse.setGeneratedBy(result, pos); + return result; + } return makeType(supers[0], pos, false); } @@ -371,9 +379,12 @@ public class Eclipse { if (binding.isUnboundWildcard()) { if (!allowCompound) { - return new QualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT, poss(pos, 3)); + TypeReference result = new QualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT, poss(pos, 3)); + Eclipse.setGeneratedBy(result, pos); + return result; } else { Wildcard out = new Wildcard(Wildcard.UNBOUND); + Eclipse.setGeneratedBy(out, pos); out.sourceStart = pos.sourceStart; out.sourceEnd = pos.sourceEnd; return out; @@ -387,6 +398,7 @@ public class Eclipse { return makeType(wildcard.bound, pos, false); } else { Wildcard out = new Wildcard(Wildcard.EXTENDS); + Eclipse.setGeneratedBy(out, pos); out.bound = makeType(wildcard.bound, pos, false); out.sourceStart = pos.sourceStart; out.sourceEnd = pos.sourceEnd; @@ -394,12 +406,15 @@ public class Eclipse { } } else if (allowCompound && wildcard.boundKind == Wildcard.SUPER) { Wildcard out = new Wildcard(Wildcard.SUPER); + Eclipse.setGeneratedBy(out, pos); out.bound = makeType(wildcard.bound, pos, false); out.sourceStart = pos.sourceStart; out.sourceEnd = pos.sourceEnd; return out; } else { - return new QualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT, poss(pos, 3)); + TypeReference result = new QualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT, poss(pos, 3)); + Eclipse.setGeneratedBy(result, pos); + return result; } } @@ -433,23 +448,34 @@ public class Eclipse { if (parts.length > 1) { TypeReference[][] typeArguments = new TypeReference[parts.length][]; typeArguments[typeArguments.length - 1] = params; - return new ParameterizedQualifiedTypeReference(parts, typeArguments, dims, poss(pos, parts.length)); + TypeReference result = new ParameterizedQualifiedTypeReference(parts, typeArguments, dims, poss(pos, parts.length)); + Eclipse.setGeneratedBy(result, pos); + return result; } - return new ParameterizedSingleTypeReference(parts[0], params, dims, pos(pos)); + TypeReference result = new ParameterizedSingleTypeReference(parts[0], params, dims, pos(pos)); + Eclipse.setGeneratedBy(result, pos); + return result; } if (dims > 0) { if (parts.length > 1) { - return new ArrayQualifiedTypeReference(parts, dims, poss(pos, parts.length)); + TypeReference result = new ArrayQualifiedTypeReference(parts, dims, poss(pos, parts.length)); + Eclipse.setGeneratedBy(result, pos); + return result; } - return new ArrayTypeReference(parts[0], dims, pos(pos)); + TypeReference result = new ArrayTypeReference(parts[0], dims, pos(pos)); + Eclipse.setGeneratedBy(result, pos); + return result; } if (parts.length > 1) { - return new QualifiedTypeReference(parts, poss(pos, parts.length)); + TypeReference result = new QualifiedTypeReference(parts, poss(pos, parts.length)); + Eclipse.setGeneratedBy(result, pos); + return result; } - return new SingleTypeReference(parts[0], pos(pos)); - + TypeReference result = new SingleTypeReference(parts[0], pos(pos)); + Eclipse.setGeneratedBy(result, pos); + return result; } private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0]; |