aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/eclipse
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2014-06-06 02:56:05 +0200
committerRoel Spilker <r.spilker@gmail.com>2014-06-06 02:56:05 +0200
commit33ead46639087a4e772d6535d0354f39fadc5724 (patch)
tree1a7806ed96d22727e7eda70fcd4231df55668f5e /src/eclipseAgent/lombok/eclipse
parent288a2236c0d5c4c129d837330ca16bfef8e5b2e2 (diff)
parent68c5b016f9a2663abc9cd4aeb0cc0034949469ca (diff)
downloadlombok-33ead46639087a4e772d6535d0354f39fadc5724.tar.gz
lombok-33ead46639087a4e772d6535d0354f39fadc5724.tar.bz2
lombok-33ead46639087a4e772d6535d0354f39fadc5724.zip
Merge branch 'master' into configResolutionInEclipse
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java10
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java14
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java5
3 files changed, 14 insertions, 15 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
index b6e75476..b1f5a43a 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java
@@ -23,6 +23,7 @@ package lombok.eclipse.agent;
import static lombok.eclipse.Eclipse.*;
import static lombok.eclipse.handlers.EclipseHandlerUtil.*;
+import static lombok.eclipse.EclipseAugments.Annotation_applied;
import java.lang.reflect.Method;
import java.util.ArrayList;
@@ -33,7 +34,6 @@ import java.util.List;
import java.util.Set;
import lombok.core.AST.Kind;
-import lombok.core.BooleanFieldAugment;
import lombok.eclipse.EclipseAST;
import lombok.eclipse.EclipseNode;
import lombok.eclipse.TransformEclipseAST;
@@ -183,10 +183,8 @@ public class PatchDelegate {
return null;
}
- private static BooleanFieldAugment<Annotation> applied = BooleanFieldAugment.augment(Annotation.class, "lombok$applied");
-
public static void markHandled(Annotation annotation) {
- applied.set(annotation);
+ Annotation_applied.set(annotation, true);
}
private static void fillMethodBindingsForFields(CompilationUnitDeclaration cud, ClassScope scope, List<BindingTuple> methodsToDelegate) {
@@ -197,7 +195,7 @@ public class PatchDelegate {
if (field.annotations == null) continue;
for (Annotation ann : field.annotations) {
if (!isDelegate(ann, decl)) continue;
- if (applied.set(ann)) continue;
+ if (Annotation_applied.getAndSet(ann, true)) continue;
if ((field.modifiers & ClassFileConstants.AccStatic) != 0) {
EclipseAST eclipseAst = TransformEclipseAST.getAST(cud, true);
@@ -257,7 +255,7 @@ public class PatchDelegate {
if (methodDecl.annotations == null) continue;
for (Annotation ann : methodDecl.annotations) {
if (!isDelegate(ann, decl)) continue;
- if (applied.set(ann)) continue;
+ if (Annotation_applied.getAndSet(ann, true)) continue;
if (!(methodDecl instanceof MethodDeclaration)) {
EclipseAST eclipseAst = TransformEclipseAST.getAST(cud, true);
eclipseAst.get(ann).addError(LEGALITY_OF_DELEGATE);
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java b/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java
index 9b3ec5df..8eec27fb 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java
@@ -31,7 +31,7 @@ import java.util.List;
import lombok.core.AST.Kind;
import lombok.core.AnnotationValues;
import lombok.core.AnnotationValues.AnnotationValueDecodeFail;
-import lombok.core.ReferenceFieldAugment;
+import lombok.core.FieldAugment;
import lombok.eclipse.EclipseAST;
import lombok.eclipse.EclipseNode;
import lombok.eclipse.TransformEclipseAST;
@@ -178,14 +178,14 @@ public class PatchExtensionMethod {
return extensionMethods;
}
- private static final ReferenceFieldAugment<MessageSend, PostponedError> postponedErrors = ReferenceFieldAugment.augment(MessageSend.class, PostponedError.class, "lombok$postponedErrors");
+ private static final FieldAugment<MessageSend, PostponedError> MessageSend_postponedErrors = FieldAugment.augment(MessageSend.class, PostponedError.class, "lombok$postponedErrors");
public static void errorNoMethodFor(ProblemReporter problemReporter, MessageSend messageSend, TypeBinding recType, TypeBinding[] params) {
- postponedErrors.set(messageSend, new PostponedNoMethodError(problemReporter, messageSend, recType, params));
+ MessageSend_postponedErrors.set(messageSend, new PostponedNoMethodError(problemReporter, messageSend, recType, params));
}
public static void invalidMethod(ProblemReporter problemReporter, MessageSend messageSend, MethodBinding method) {
- postponedErrors.set(messageSend, new PostponedInvalidMethodError(problemReporter, messageSend, method));
+ MessageSend_postponedErrors.set(messageSend, new PostponedInvalidMethodError(problemReporter, messageSend, method));
}
public static TypeBinding resolveType(TypeBinding resolvedType, MessageSend methodCall, BlockScope scope) {
@@ -215,7 +215,7 @@ public class PatchExtensionMethod {
if (!extension.suppressBaseMethods && !(methodCall.binding instanceof ProblemMethodBinding)) continue;
for (MethodBinding extensionMethod : extension.extensionMethods) {
if (!Arrays.equals(methodCall.selector, extensionMethod.selector)) continue;
- postponedErrors.clear(methodCall);
+ MessageSend_postponedErrors.clear(methodCall);
if (methodCall.receiver instanceof ThisReference) {
methodCall.receiver.bits &= ~ASTNode.IsImplicitThis;
}
@@ -257,10 +257,10 @@ public class PatchExtensionMethod {
}
}
- PostponedError error = postponedErrors.get(methodCall);
+ PostponedError error = MessageSend_postponedErrors.get(methodCall);
if (error != null) error.fire();
- postponedErrors.clear(methodCall);
+ MessageSend_postponedErrors.clear(methodCall);
return resolvedType;
}
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java
index 2370d3ff..d1c668a0 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java
@@ -32,6 +32,7 @@ import java.util.Stack;
import lombok.core.DiagnosticsReceiver;
import lombok.core.PostCompiler;
import lombok.core.Version;
+import lombok.eclipse.EclipseAugments;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IAnnotatable;
@@ -255,13 +256,13 @@ public class PatchFixes {
public static void setIsGeneratedFlag(org.eclipse.jdt.core.dom.ASTNode domNode,
org.eclipse.jdt.internal.compiler.ast.ASTNode internalNode) throws Exception {
if (internalNode == null || domNode == null) return;
- boolean isGenerated = internalNode.getClass().getField("$generatedBy").get(internalNode) != null;
+ boolean isGenerated = EclipseAugments.ASTNode_generatedBy.get(internalNode) != null;
if (isGenerated) domNode.getClass().getField("$isGenerated").set(domNode, true);
}
public static void setIsGeneratedFlagForName(org.eclipse.jdt.core.dom.Name name, Object internalNode) throws Exception {
if (internalNode instanceof org.eclipse.jdt.internal.compiler.ast.ASTNode) {
- if (internalNode.getClass().getField("$generatedBy").get(internalNode) != null) {
+ if (EclipseAugments.ASTNode_generatedBy.get((org.eclipse.jdt.internal.compiler.ast.ASTNode) internalNode) != null) {
name.getClass().getField("$isGenerated").set(name, true);
}
}