aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent
diff options
context:
space:
mode:
authorPhilipp Eichhorn <peichhor@web.de>2012-07-05 22:42:43 +0200
committerPhilipp Eichhorn <peichhor@web.de>2012-07-05 22:42:43 +0200
commit5f8aa2e9b0f58e9f0436275ab0feb44a70fdf622 (patch)
treeb9e43126b3e9eb3c0dc49737dd28949de752e93d /src/eclipseAgent
parent39a76386b6a3c0c30f6597c473ba7dd6f32c9a88 (diff)
downloadlombok-5f8aa2e9b0f58e9f0436275ab0feb44a70fdf622.tar.gz
lombok-5f8aa2e9b0f58e9f0436275ab0feb44a70fdf622.tar.bz2
lombok-5f8aa2e9b0f58e9f0436275ab0feb44a70fdf622.zip
fixed stupid memleak in PatchExtensionMethod.. sorry my bad..
Diffstat (limited to 'src/eclipseAgent')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java b/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java
index ebfb1a05..b96f70c9 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchExtensionMethod.java
@@ -23,6 +23,7 @@ package lombok.eclipse.agent;
import static lombok.eclipse.handlers.EclipseHandlerUtil.createAnnotation;
+import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -66,35 +67,37 @@ public class PatchExtensionMethod {
private static class PostponedNoMethodError implements PostponedError {
private final ProblemReporter problemReporter;
- private final MessageSend messageSend;
+ private final WeakReference<MessageSend> messageSendRef;
private final TypeBinding recType;
private final TypeBinding[] params;
PostponedNoMethodError(ProblemReporter problemReporter, MessageSend messageSend, TypeBinding recType, TypeBinding[] params) {
this.problemReporter = problemReporter;
- this.messageSend = messageSend;
+ this.messageSendRef = new WeakReference<MessageSend>(messageSend);
this.recType = recType;
this.params = params;
}
public void fire() {
- problemReporter.errorNoMethodFor(messageSend, recType, params);
+ MessageSend messageSend = messageSendRef.get();
+ if (messageSend != null) problemReporter.errorNoMethodFor(messageSend, recType, params);
}
}
private static class PostponedInvalidMethodError implements PostponedError {
private final ProblemReporter problemReporter;
- private final MessageSend messageSend;
+ private final WeakReference<MessageSend> messageSendRef;
private final MethodBinding method;
PostponedInvalidMethodError(ProblemReporter problemReporter, MessageSend messageSend, MethodBinding method) {
this.problemReporter = problemReporter;
- this.messageSend = messageSend;
+ this.messageSendRef = new WeakReference<MessageSend>(messageSend);
this.method = method;
}
public void fire() {
- problemReporter.invalidMethod(messageSend, method);
+ MessageSend messageSend = messageSendRef.get();
+ if (messageSend != null) problemReporter.invalidMethod(messageSend, method);
}
}
@@ -277,7 +280,4 @@ public class PatchExtensionMethod {
return new QualifiedNameReference(sources, poss, source.sourceStart, source.sourceEnd);
}
}
-
-
-
}