mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-14 14:17:48 +00:00
Set the source positions in eclipse of copied over annotations (used in @NonNull/@Nullable and getter/setter/constructor generation) to 0, as eclipse mysteriously fails for annotations copied WITH source positions, but only on methods (which happens for @Getter).
This commit is contained in:
1 parent
4e152f2f14
commit
d16775032b
2 files changed
+4
-4
No files matched your search
@@ -275,16 +275,16 @@ public class Eclipse {
|
||||
|
||||
public static Annotation copyAnnotation(Annotation annotation) {
|
||||
if (annotation instanceof MarkerAnnotation) {
|
||||
return new MarkerAnnotation(copyType(annotation.type), annotation.sourceStart);
|
||||
return new MarkerAnnotation(copyType(annotation.type), 0);
|
||||
}
|
||||
|
||||
if (annotation instanceof SingleMemberAnnotation) {
|
||||
SingleMemberAnnotation result = new SingleMemberAnnotation(copyType(annotation.type), annotation.sourceStart);
|
||||
SingleMemberAnnotation result = new SingleMemberAnnotation(copyType(annotation.type), 0);
|
||||
result.memberValue = ((SingleMemberAnnotation)annotation).memberValue;
|
||||
}
|
||||
|
||||
if (annotation instanceof NormalAnnotation) {
|
||||
NormalAnnotation result = new NormalAnnotation(copyType(annotation.type), annotation.sourceStart);
|
||||
NormalAnnotation result = new NormalAnnotation(copyType(annotation.type), 0);
|
||||
result.memberValuePairs = ((NormalAnnotation)annotation).memberValuePairs;
|
||||
}
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ public class HandleEqualsAndHashCode implements EclipseAnnotationHandler<EqualsA
|
||||
method.modifiers = PKG.toModifier(AccessLevel.PUBLIC);
|
||||
method.returnType = TypeReference.baseTypeReference(TypeIds.T_int, 0);
|
||||
method.annotations = new Annotation[] {
|
||||
new MarkerAnnotation(new QualifiedTypeReference(TypeConstants.JAVA_LANG_OVERRIDE, new long[] { 0, 0, 0}), 0)
|
||||
new MarkerAnnotation(new QualifiedTypeReference(TypeConstants.JAVA_LANG_OVERRIDE, new long[] {0, 0, 0}), 0)
|
||||
};
|
||||
method.selector = "hashCode".toCharArray();
|
||||
method.thrownExceptions = null;
|
||||
|
||||
Reference in new issue
Block a user