aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2020-09-17 22:18:31 +0200
committerGitHub <noreply@github.com>2020-09-17 22:18:31 +0200
commit007c4e7cb2d64afedcd942ab788bc1b15191a309 (patch)
tree86ec614d0ec934551b352c01200e1fc0a50015a3 /src/core/lombok
parent60d86fab3c0d7716cf78ce6cfc62193395f7b3c3 (diff)
parent54ea7c1c6bea4d2e410e737ee8cc66315567e926 (diff)
downloadlombok-007c4e7cb2d64afedcd942ab788bc1b15191a309.tar.gz
lombok-007c4e7cb2d64afedcd942ab788bc1b15191a309.tar.bz2
lombok-007c4e7cb2d64afedcd942ab788bc1b15191a309.zip
Merge pull request #2570 from Rawi01/eclipse-test-fixes
Eclipse test fixes
Diffstat (limited to 'src/core/lombok')
-rw-r--r--src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java17
-rw-r--r--src/core/lombok/eclipse/handlers/HandleLog.java16
-rw-r--r--src/core/lombok/eclipse/handlers/HandleSuperBuilder.java1
3 files changed, 6 insertions, 28 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
index 6bfcf16e..58e18699 100644
--- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
+++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
@@ -2470,18 +2470,7 @@ public class EclipseHandlerUtil {
}
public static NameReference createNameReference(String name, Annotation source) {
- int pS = source.sourceStart, pE = source.sourceEnd;
- long p = (long)pS << 32 | pE;
-
- char[][] nameTokens = fromQualifiedName(name);
- long[] pos = new long[nameTokens.length];
- Arrays.fill(pos, p);
-
- QualifiedNameReference nameReference = new QualifiedNameReference(nameTokens, pos, pS, pE);
- nameReference.statementEnd = pE;
-
- setGeneratedBy(nameReference, source);
- return nameReference;
+ return generateQualifiedNameRef(source, fromQualifiedName(name));
}
private static long[] copy(long[] array) {
@@ -2635,4 +2624,8 @@ public class EclipseHandlerUtil {
setGeneratedBy(ref, source);
return ref;
}
+
+ public static TypeReference createTypeReference(String typeName, ASTNode source) {
+ return generateQualifiedTypeRef(source, fromQualifiedName(typeName));
+ }
}
diff --git a/src/core/lombok/eclipse/handlers/HandleLog.java b/src/core/lombok/eclipse/handlers/HandleLog.java
index a0e431e5..8297426d 100644
--- a/src/core/lombok/eclipse/handlers/HandleLog.java
+++ b/src/core/lombok/eclipse/handlers/HandleLog.java
@@ -22,11 +22,9 @@
package lombok.eclipse.handlers;
import static lombok.core.handlers.HandlerUtil.handleFlagUsage;
-import static lombok.eclipse.Eclipse.fromQualifiedName;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
import java.lang.reflect.Modifier;
-import java.util.Arrays;
import java.util.List;
import org.eclipse.jdt.internal.compiler.ast.Annotation;
@@ -35,7 +33,6 @@ import org.eclipse.jdt.internal.compiler.ast.Expression;
import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
import org.eclipse.jdt.internal.compiler.ast.MessageSend;
import org.eclipse.jdt.internal.compiler.ast.NullLiteral;
-import org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference;
import org.eclipse.jdt.internal.compiler.ast.SingleTypeReference;
import org.eclipse.jdt.internal.compiler.ast.StringLiteral;
import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
@@ -156,19 +153,6 @@ public class HandleLog {
return fieldDecl;
}
- public static TypeReference createTypeReference(String typeName, Annotation source) {
- int pS = source.sourceStart, pE = source.sourceEnd;
- long p = (long) pS << 32 | pE;
-
- char[][] typeNameTokens = fromQualifiedName(typeName);
- long[] pos = new long[typeNameTokens.length];
- Arrays.fill(pos, p);
-
- TypeReference typeReference = new QualifiedTypeReference(typeNameTokens, pos);
- setGeneratedBy(typeReference, source);
- return typeReference;
- }
-
private static final Expression[] createFactoryParameters(ClassLiteralAccess loggingType, Annotation source, List<LogFactoryParameter> parameters, Expression loggerTopic) {
Expression[] expressions = new Expression[parameters.size()];
int pS = source.sourceStart, pE = source.sourceEnd;
diff --git a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
index b1e7c419..79b7e816 100644
--- a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
+++ b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java
@@ -741,6 +741,7 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler<SuperBuilder> {
}
out.statements = body.isEmpty() ? null : body.toArray(new Statement[0]);
+ out.traverse(new SetGeneratedByVisitor(source), (ClassScope) null);
return out;
}