[issue #3014] test-case that reproduces this problem.

This commit is contained in:
Reinier Zwitserloot committed 2021-10-26 03:49:23 +02:00
1 parent 7c8ba501de
commit c359a4b41f
3 files changed
+17

No files matched your search

@@ -40,6 +40,7 @@ import lombok.javac.Javac;
public class DirectoryRunner extends Runner {
/** Add 1 or more file names to reduce the testset to just the named file(s). No files = test it all. */
private static final List<String> DEBUG_FOCUS_ON_FILE = Arrays.asList(
"BuilderNestedInEnum.java"
);
public enum Compiler {
@@ -161,6 +161,7 @@ public class LombokTestSource {
private static final Pattern UNCHANGED_PATTERN = Pattern.compile("^\\s*unchanged\\s*(?:[-:].*)?$", Pattern.CASE_INSENSITIVE);
private static final Pattern SKIP_COMPARE_CONTENT_PATTERN = Pattern.compile("^\\s*skip[- ]?compare[- ]?contents?\\s*(?:[-:].*)?$", Pattern.CASE_INSENSITIVE);
private static final Pattern SKIP_IDEMPOTENT_PATTERN = Pattern.compile("^\\s*skip[- ]?idempotent\\s*(?:[-:].*)?$", Pattern.CASE_INSENSITIVE);
private static final Pattern ISSUE_REF_PATTERN = Pattern.compile("^\\s*issue #?\\d+(:?\\s+.*)?$", Pattern.CASE_INSENSITIVE);
private LombokTestSource(File file, String content, List<CompilerMessageMatcher> messages, List<String> directives) {
this.file = file;
@@ -200,6 +201,9 @@ public class LombokTestSource {
skipIdempotent = true;
continue;
}
if (ISSUE_REF_PATTERN.matcher(directive).matches()) {
continue;
}
if (lc.startsWith("platform ")) {
String platformDesc = lc.substring("platform ".length());
@@ -0,0 +1,12 @@
// issue #3014: Builder check if its on a non-static inner class and errors if it is. But it was erroring here even though it is on a static inner class.
class BuilderNestedInEnum {
public enum TestEnum {
FOO, BAR;
@lombok.Builder
@lombok.Value
public static class TestBuilder {
String field;
}
}
}