aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java
index 6d5fdaec..8da7f668 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchFixes.java
@@ -41,6 +41,16 @@ import org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.eclipse.jdt.internal.core.dom.rewrite.TokenScanner;
public class PatchFixes {
+ public static boolean isGenerated(org.eclipse.jdt.core.dom.Statement statement) {
+ boolean result = false;
+ try {
+ result = ((Boolean)statement.getClass().getField("$isGenerated").get(statement)).booleanValue();
+ } catch (Exception e) {
+ // better to assume it isn't generated
+ }
+ return result;
+ }
+
public static int fixRetrieveStartingCatchPosition(int original, int start) {
return original == -1 ? start : original;
}