aboutsummaryrefslogtreecommitdiff
path: root/test/core/src/lombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2021-09-16 02:05:15 +0200
committerGitHub <noreply@github.com>2021-09-16 02:05:15 +0200
commit14aaf25ede37228f186a7029aa9567353eb539ca (patch)
tree052cdced9b027c700b63f5f2ad3c627d5a7e61d3 /test/core/src/lombok
parentad04c1833c78be6ec2c3ac223fad096c0ce39180 (diff)
parentee9b1128b49841c52a23e42a6e069477fd367db4 (diff)
downloadlombok-14aaf25ede37228f186a7029aa9567353eb539ca.tar.gz
lombok-14aaf25ede37228f186a7029aa9567353eb539ca.tar.bz2
lombok-14aaf25ede37228f186a7029aa9567353eb539ca.zip
Merge pull request #2932 from Rawi01/record-nonnull-symbols
Keep record compact constructor parameters
Diffstat (limited to 'test/core/src/lombok')
-rw-r--r--test/core/src/lombok/RunTestsViaDelombok.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/core/src/lombok/RunTestsViaDelombok.java b/test/core/src/lombok/RunTestsViaDelombok.java
index 23a42c67..e4eb1a30 100644
--- a/test/core/src/lombok/RunTestsViaDelombok.java
+++ b/test/core/src/lombok/RunTestsViaDelombok.java
@@ -42,7 +42,6 @@ import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
-import javax.lang.model.element.ElementKind;
import javax.lang.model.element.TypeElement;
import com.sun.source.util.TreePath;
@@ -211,8 +210,8 @@ public class RunTestsViaDelombok extends AbstractRunTests {
}
@Override public void visitVarDef(JCVariableDecl tree) {
- // Skip non-field variables
- if (!(parent instanceof JCClassDecl)) return;
+ // Skip local variables
+ if (!(parent instanceof JCClassDecl || parent instanceof JCMethodDecl)) return;
validateSymbol(tree, tree.sym);
super.visitVarDef(tree);
@@ -222,8 +221,8 @@ public class RunTestsViaDelombok extends AbstractRunTests {
if (sym == null) {
fail("Missing symbol for " + tree);
}
- // Skip top level classes
- if (sym.owner.getKind() == ElementKind.PACKAGE) return;
+ // Only classes have enclosed elements, skip everything else
+ if (!sym.owner.getKind().isClass()) return;
if (!sym.owner.getEnclosedElements().contains(sym)) {
fail(tree + " not added to parent");