aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/launch
diff options
context:
space:
mode:
authorTill Brychcy <till.brychcy@mercateo.com>2019-06-15 11:41:40 +0200
committerTill Brychcy <till.brychcy@mercateo.com>2019-06-15 17:03:09 +0200
commit8a6603d191f7b8d1f27d32f3b2fa25d1c2eb8e53 (patch)
treebbeaa9d76d8b31e83126dd7eec62bc33cb28810c /src/eclipseAgent/lombok/launch
parentd9b8b14575280cd6411a6a157b6c4e8117edb1ba (diff)
downloadlombok-8a6603d191f7b8d1f27d32f3b2fa25d1c2eb8e53.tar.gz
lombok-8a6603d191f7b8d1f27d32f3b2fa25d1c2eb8e53.tar.bz2
lombok-8a6603d191f7b8d1f27d32f3b2fa25d1c2eb8e53.zip
Avoid Eclipse warnings about null checks generated for lombok.NonNull when NonNullByDefault is used
Diffstat (limited to 'src/eclipseAgent/lombok/launch')
-rwxr-xr-xsrc/eclipseAgent/lombok/launch/PatchFixesHider.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/eclipseAgent/lombok/launch/PatchFixesHider.java b/src/eclipseAgent/lombok/launch/PatchFixesHider.java
index 3741aba8..563beab1 100755
--- a/src/eclipseAgent/lombok/launch/PatchFixesHider.java
+++ b/src/eclipseAgent/lombok/launch/PatchFixesHider.java
@@ -315,7 +315,17 @@ final class PatchFixesHider {
}
return result;
}
-
+
+ public static boolean isGenerated(org.eclipse.jdt.internal.compiler.ast.ASTNode node) {
+ boolean result = false;
+ try {
+ result = node.getClass().getField("$generatedBy").get(node) != null;
+ } catch (Exception e) {
+ // better to assume it isn't generated
+ }
+ return result;
+ }
+
public static boolean isListRewriteOnGeneratedNode(org.eclipse.jdt.core.dom.rewrite.ListRewrite rewrite) {
return isGenerated(rewrite.getParent());
}