aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/configuration/resource/configurationRoot/out.txt12
-rw-r--r--test/core/src/lombok/AbstractRunTests.java4
-rw-r--r--test/core/src/lombok/LombokTestSource.java32
-rw-r--r--test/core/src/lombok/RunAllTests.java4
-rw-r--r--test/core/src/lombok/RunTestsViaDelombok.java4
-rw-r--r--test/core/src/lombok/RunTestsViaEcj.java8
-rw-r--r--test/core/src/lombok/core/RunCoreTests.java31
-rw-r--r--test/core/src/lombok/core/TestSingulars.java52
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java93
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java76
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularLists.java105
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularMaps.java173
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularNoAutosingularize.java103
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java75
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularSets.java129
-rw-r--r--test/transform/resource/after-delombok/EncodingUsAscii.java9
-rw-r--r--test/transform/resource/after-delombok/EncodingUtf8.java8
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java88
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java71
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularLists.java101
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularMaps.java177
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularNoAutosingularize.java99
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java71
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularSets.java125
-rw-r--r--test/transform/resource/after-ecj/BuilderWithExistingBuilderClass.java2
-rw-r--r--test/transform/resource/after-ecj/EncodingUsAscii.java1
-rw-r--r--test/transform/resource/after-ecj/EncodingUtf8.java9
-rw-r--r--test/transform/resource/before/BuilderSingularGuavaListsSets.java14
-rw-r--r--test/transform/resource/before/BuilderSingularGuavaMaps.java12
-rw-r--r--test/transform/resource/before/BuilderSingularLists.java11
-rw-r--r--test/transform/resource/before/BuilderSingularMaps.java12
-rw-r--r--test/transform/resource/before/BuilderSingularNoAutoSingularize.java11
-rw-r--r--test/transform/resource/before/BuilderSingularRedirectToGuava.java13
-rw-r--r--test/transform/resource/before/BuilderSingularSets.java12
-rw-r--r--test/transform/resource/before/BuilderWithExistingBuilderClass.java2
-rw-r--r--test/transform/resource/before/EncodingUsAscii.java5
-rw-r--r--test/transform/resource/before/EncodingUtf8.java5
-rw-r--r--test/transform/resource/messages-delombok/BuilderSingularNoAutosingularize.java.messages2
-rw-r--r--test/transform/resource/messages-ecj/BuilderComplex.java.messages1
-rw-r--r--test/transform/resource/messages-ecj/BuilderSingularNoAutosingularize.java.messages2
40 files changed, 1742 insertions, 22 deletions
diff --git a/test/configuration/resource/configurationRoot/out.txt b/test/configuration/resource/configurationRoot/out.txt
index 625115a4..de219694 100644
--- a/test/configuration/resource/configurationRoot/out.txt
+++ b/test/configuration/resource/configurationRoot/out.txt
@@ -8,7 +8,7 @@ lombok.accessors.flagUsage = ERROR
# BASE/d1/d11/lombok.config:
# 3: lombok.accessors.flagUsage = ERROR
-# Generate setters that return 'this' instead of 'void'.
+# Generate setters that return 'this' instead of 'void' (default: false).
lombok.accessors.chain = false
# BASE/d1/lombok.config:
# <'lombok.accessors.chain' not mentioned>
@@ -24,7 +24,7 @@ lombok.accessors.prefix += f
# BASE/d1/d11/lombok.config:
# 4: lombok.accessors.prefix += f
-# Use this name for the generated logger fields (default: 'log')
+# Use this name for the generated logger fields (default: 'log').
clear lombok.log.fieldName
@@ -43,7 +43,7 @@ lombok.accessors.flagUsage = ERROR
# BASE/d1/d11/d111/lombok.config:
# <'lombok.accessors.flagUsage' not mentioned>
-# Generate setters that return 'this' instead of 'void'.
+# Generate setters that return 'this' instead of 'void' (default: false).
clear lombok.accessors.chain
# BASE/d1/lombok.config:
# <'lombok.accessors.chain' not mentioned>
@@ -66,7 +66,7 @@ lombok.accessors.prefix += m_
# BASE/d1/d11/d111/lombok.config:
# 2: lombok.accessors.prefix += m_
-# Use this name for the generated logger fields (default: 'log')
+# Use this name for the generated logger fields (default: 'log').
clear lombok.log.fieldName
@@ -75,7 +75,7 @@ Configuration for 'BASE/d1/d12'.
# Emit a warning or error if @Accessors is used.
clear lombok.accessors.flagUsage
-# Generate setters that return 'this' instead of 'void'.
+# Generate setters that return 'this' instead of 'void' (default: false).
lombok.accessors.chain = true
# BASE/d1/lombok.config:
# <'lombok.accessors.chain' not mentioned>
@@ -86,5 +86,5 @@ lombok.accessors.chain = true
# Strip this field prefix, like 'f' or 'm_', from the names of generated getters and setters.
clear lombok.accessors.prefix
-# Use this name for the generated logger fields (default: 'log')
+# Use this name for the generated logger fields (default: 'log').
clear lombok.log.fieldName \ No newline at end of file
diff --git a/test/core/src/lombok/AbstractRunTests.java b/test/core/src/lombok/AbstractRunTests.java
index a1f535b4..85d4d4f3 100644
--- a/test/core/src/lombok/AbstractRunTests.java
+++ b/test/core/src/lombok/AbstractRunTests.java
@@ -75,7 +75,7 @@ public abstract class AbstractRunTests {
}
});
- transformCode(messages, writer, file);
+ transformCode(messages, writer, file, sourceDirectives.getSpecifiedEncoding());
compare(file.getName(), expected, writer.toString(), messages, params.printErrors(), sourceDirectives.isSkipCompareContent() || expected.isSkipCompareContent());
return true;
@@ -97,7 +97,7 @@ public abstract class AbstractRunTests {
return 8;
}
- protected abstract void transformCode(Collection<CompilerMessage> messages, StringWriter result, File file) throws Throwable;
+ protected abstract void transformCode(Collection<CompilerMessage> messages, StringWriter result, File file, String encoding) throws Throwable;
protected String readFile(File file) throws IOException {
BufferedReader reader;
diff --git a/test/core/src/lombok/LombokTestSource.java b/test/core/src/lombok/LombokTestSource.java
index 402001e9..f31d7be7 100644
--- a/test/core/src/lombok/LombokTestSource.java
+++ b/test/core/src/lombok/LombokTestSource.java
@@ -49,7 +49,8 @@ public class LombokTestSource {
private final boolean skipCompareContent;
private final int versionLowerLimit, versionUpperLimit;
private final ConfigurationResolver configuration;
-
+ private final String specifiedEncoding;
+
public boolean versionWithinLimit(int version) {
return version >= versionLowerLimit && version <= versionUpperLimit;
}
@@ -74,6 +75,10 @@ public class LombokTestSource {
return skipCompareContent;
}
+ public String getSpecifiedEncoding() {
+ return specifiedEncoding;
+ }
+
public ConfigurationResolver getConfiguration() {
return configuration;
}
@@ -123,6 +128,7 @@ public class LombokTestSource {
int versionUpper = Integer.MAX_VALUE;
boolean ignore = false;
boolean skipCompareContent = false;
+ String encoding = null;
for (String directive : directives) {
directive = directive.trim();
@@ -154,10 +160,15 @@ public class LombokTestSource {
continue;
}
+ if (lc.startsWith("encoding:")) {
+ encoding = directive.substring(9).trim();
+ continue;
+ }
+
Assert.fail("Directive line \"" + directive + "\" in '" + file.getAbsolutePath() + "' invalid: unrecognized directive.");
throw new RuntimeException();
}
-
+ this.specifiedEncoding = encoding;
this.versionLowerLimit = versionLower;
this.versionUpperLimit = versionUpper;
this.ignore = ignore;
@@ -194,13 +205,17 @@ public class LombokTestSource {
}
public static LombokTestSource read(File sourceFolder, File messagesFolder, String fileName) throws IOException {
+ return read0(sourceFolder, messagesFolder, fileName, "UTF-8");
+ }
+
+ private static LombokTestSource read0(File sourceFolder, File messagesFolder, String fileName, String encoding) throws IOException {
StringBuilder content = null;
List<String> directives = new ArrayList<String>();
File sourceFile = new File(sourceFolder, fileName);
if (sourceFile.exists()) {
@Cleanup val rawIn = new FileInputStream(sourceFile);
- BufferedReader in = new BufferedReader(new InputStreamReader(rawIn, "UTF-8"));
+ BufferedReader in = new BufferedReader(new InputStreamReader(rawIn, encoding));
for (String i = in.readLine(); i != null; i = in.readLine()) {
if (content != null) {
content.append(i).append("\n");
@@ -234,6 +249,15 @@ public class LombokTestSource {
}
}
- return new LombokTestSource(sourceFile, content.toString(), messages, directives);
+ LombokTestSource source = new LombokTestSource(sourceFile, content.toString(), messages, directives);
+ String specifiedEncoding = source.getSpecifiedEncoding();
+
+ // The source file has an 'encoding' header to test encoding issues. Of course, reading the encoding header
+ // requires knowing the encoding of the file first. In practice we get away with it, because UTF-8 and US-ASCII are compatible enough.
+ // The fix is therefore to read in as UTF-8 initially, and if the file requests that it should be read as another encoding, toss it all
+ // and reread that way.
+
+ if (specifiedEncoding == null || specifiedEncoding.equalsIgnoreCase(encoding)) return source;
+ return read0(sourceFolder, messagesFolder, fileName, specifiedEncoding);
}
}
diff --git a/test/core/src/lombok/RunAllTests.java b/test/core/src/lombok/RunAllTests.java
index 9f56b45b..1ca76af5 100644
--- a/test/core/src/lombok/RunAllTests.java
+++ b/test/core/src/lombok/RunAllTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2014 The Project Lombok Authors.
+ * Copyright (C) 2011-2015 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -26,6 +26,6 @@ import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
-@SuiteClasses({lombok.transform.RunTransformTests.class, lombok.bytecode.RunBytecodeTests.class, lombok.core.configuration.RunConfigurationTests.class})
+@SuiteClasses({lombok.transform.RunTransformTests.class, lombok.bytecode.RunBytecodeTests.class, lombok.core.configuration.RunConfigurationTests.class, lombok.core.RunCoreTests.class})
public class RunAllTests {
}
diff --git a/test/core/src/lombok/RunTestsViaDelombok.java b/test/core/src/lombok/RunTestsViaDelombok.java
index 6a08642b..1482c865 100644
--- a/test/core/src/lombok/RunTestsViaDelombok.java
+++ b/test/core/src/lombok/RunTestsViaDelombok.java
@@ -34,10 +34,10 @@ public class RunTestsViaDelombok extends AbstractRunTests {
private Delombok delombok = new Delombok();
@Override
- public void transformCode(Collection<CompilerMessage> messages, StringWriter result, final File file) throws Throwable {
+ public void transformCode(Collection<CompilerMessage> messages, StringWriter result, final File file, String encoding) throws Throwable {
delombok.setVerbose(false);
delombok.setForceProcess(true);
- delombok.setCharset("UTF-8");
+ delombok.setCharset(encoding == null ? "UTF-8" : encoding);
delombok.setDiagnosticsListener(new CapturingDiagnosticListener(file, messages));
diff --git a/test/core/src/lombok/RunTestsViaEcj.java b/test/core/src/lombok/RunTestsViaEcj.java
index f4584493..74fe6e92 100644
--- a/test/core/src/lombok/RunTestsViaEcj.java
+++ b/test/core/src/lombok/RunTestsViaEcj.java
@@ -93,7 +93,7 @@ public class RunTestsViaEcj extends AbstractRunTests {
}
@Override
- public void transformCode(Collection<CompilerMessage> messages, StringWriter result, File file) throws Throwable {
+ public void transformCode(Collection<CompilerMessage> messages, StringWriter result, File file, String encoding) throws Throwable {
final AtomicReference<CompilationResult> compilationResult_ = new AtomicReference<CompilationResult>();
final AtomicReference<CompilationUnitDeclaration> compilationUnit_ = new AtomicReference<CompilationUnitDeclaration>();
ICompilerRequestor bitbucketRequestor = new ICompilerRequestor() {
@@ -103,7 +103,7 @@ public class RunTestsViaEcj extends AbstractRunTests {
};
String source = readFile(file);
- final CompilationUnit sourceUnit = new CompilationUnit(source.toCharArray(), file.getName(), "UTF-8");
+ final CompilationUnit sourceUnit = new CompilationUnit(source.toCharArray(), file.getName(), encoding == null ? "UTF-8" : encoding);
Compiler ecjCompiler = new Compiler(createFileSystem(file), ecjErrorHandlingPolicy(), ecjCompilerOptions(), bitbucketRequestor, new DefaultProblemFactory(Locale.ENGLISH)) {
@Override protected synchronized void addCompilationUnit(ICompilationUnit inUnit, CompilationUnitDeclaration parsedUnit) {
@@ -112,8 +112,6 @@ public class RunTestsViaEcj extends AbstractRunTests {
}
};
- // TODO: Create a configuration based on confLines and set this up so that this compile run will use them.
-
ecjCompiler.compile(new ICompilationUnit[] {sourceUnit});
CompilationResult compilationResult = compilationResult_.get();
@@ -137,12 +135,14 @@ public class RunTestsViaEcj extends AbstractRunTests {
i.remove();
}
}
+ classpath.add("bin");
classpath.add("dist/lombok.jar");
classpath.add("lib/test/commons-logging-commons-logging.jar");
classpath.add("lib/test/org.slf4j-slf4j-api.jar");
classpath.add("lib/test/org.slf4j-slf4j-ext.jar");
classpath.add("lib/test/log4j-log4j.jar");
classpath.add("lib/test/org.apache.logging.log4j-log4j-api.jar");
+ classpath.add("lib/test/com.google.guava-guava.jar");
return new FileSystem(classpath.toArray(new String[0]), new String[] {file.getAbsolutePath()}, "UTF-8");
}
}
diff --git a/test/core/src/lombok/core/RunCoreTests.java b/test/core/src/lombok/core/RunCoreTests.java
new file mode 100644
index 00000000..8ac7cf81
--- /dev/null
+++ b/test/core/src/lombok/core/RunCoreTests.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2015 The Project Lombok Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package lombok.core;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+@RunWith(Suite.class)
+@SuiteClasses({TestSingulars.class})
+public class RunCoreTests {
+}
diff --git a/test/core/src/lombok/core/TestSingulars.java b/test/core/src/lombok/core/TestSingulars.java
new file mode 100644
index 00000000..1134af08
--- /dev/null
+++ b/test/core/src/lombok/core/TestSingulars.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2015 The Project Lombok Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package lombok.core;
+
+import static lombok.core.handlers.Singulars.autoSingularize;
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class TestSingulars {
+ @Test
+ public void testSingulars() {
+ assertEquals(null, autoSingularize("axes"));
+ assertEquals("adjective", autoSingularize("adjectives"));
+ assertEquals("bus", autoSingularize("buses"));
+ assertEquals("octopus", autoSingularize("octopodes"));
+ assertEquals(null, autoSingularize("octopi"));
+ assertEquals("elf", autoSingularize("elves"));
+ assertEquals("jack", autoSingularize("jacks"));
+ assertEquals("colloquy", autoSingularize("colloquies"));
+ assertEquals(null, autoSingularize("series"));
+ assertEquals("man", autoSingularize("men"));
+ assertEquals(null, autoSingularize("highwaymen"));
+ assertEquals("caveMan", autoSingularize("caveMen"));
+ assertEquals(null, autoSingularize("jackss"));
+ assertEquals(null, autoSingularize("virus"));
+ assertEquals("quiz", autoSingularize("quizzes"));
+ assertEquals("database", autoSingularize("databases"));
+ assertEquals("dataBase", autoSingularize("dataBases"));
+ assertEquals("Query", autoSingularize("Queries"));
+ assertEquals("Movie", autoSingularize("Movies"));
+ }
+}
diff --git a/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java b/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java
new file mode 100644
index 00000000..5b9d620c
--- /dev/null
+++ b/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java
@@ -0,0 +1,93 @@
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableCollection;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.ImmutableSortedSet;
+class BuilderSingularGuavaListsSets<T> {
+ private ImmutableList<T> cards;
+ private ImmutableCollection<? extends Number> frogs;
+ @SuppressWarnings("all")
+ private ImmutableSet rawSet;
+ private ImmutableSortedSet<String> passes;
+ @java.lang.SuppressWarnings("all")
+ BuilderSingularGuavaListsSets(final ImmutableList<T> cards, final ImmutableCollection<? extends Number> frogs, final ImmutableSet rawSet, final ImmutableSortedSet<String> passes) {
+ this.cards = cards;
+ this.frogs = frogs;
+ this.rawSet = rawSet;
+ this.passes = passes;
+ }
+ @java.lang.SuppressWarnings("all")
+ public static class BuilderSingularGuavaListsSetsBuilder<T> {
+ private com.google.common.collect.ImmutableList.Builder<T> cards;
+ private com.google.common.collect.ImmutableList.Builder<Number> frogs;
+ private com.google.common.collect.ImmutableSet.Builder<java.lang.Object> rawSet;
+ private com.google.common.collect.ImmutableSortedSet.Builder<String> passes;
+ @java.lang.SuppressWarnings("all")
+ BuilderSingularGuavaListsSetsBuilder() {
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaListsSetsBuilder<T> card(final T card) {
+ if (this.cards == null) this.cards = com.google.common.collect.ImmutableList.builder();
+ this.cards.add(card);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaListsSetsBuilder<T> cards(final java.lang.Iterable<? extends T> cards) {
+ if (this.cards == null) this.cards = com.google.common.collect.ImmutableList.builder();
+ this.cards.addAll(cards);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaListsSetsBuilder<T> frog(final Number frog) {
+ if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder();
+ this.frogs.add(frog);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaListsSetsBuilder<T> frogs(final java.lang.Iterable<? extends Number> frogs) {
+ if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder();
+ this.frogs.addAll(frogs);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaListsSetsBuilder<T> rawSet(final java.lang.Object rawSet) {
+ if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder();
+ this.rawSet.add(rawSet);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaListsSetsBuilder<T> rawSet(final java.lang.Iterable<?> rawSet) {
+ if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder();
+ this.rawSet.addAll(rawSet);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaListsSetsBuilder<T> pass(final String pass) {
+ if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder();
+ this.passes.add(pass);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaListsSetsBuilder<T> passes(final java.lang.Iterable<? extends String> passes) {
+ if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder();
+ this.passes.addAll(passes);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaListsSets<T> build() {
+ com.google.common.collect.ImmutableList<T> cards = this.cards == null ? com.google.common.collect.ImmutableList.<T>of() : this.cards.build();
+ com.google.common.collect.ImmutableCollection<Number> frogs = this.frogs == null ? com.google.common.collect.ImmutableList.<Number>of() : this.frogs.build();
+ com.google.common.collect.ImmutableSet<java.lang.Object> rawSet = this.rawSet == null ? com.google.common.collect.ImmutableSet.<java.lang.Object>of() : this.rawSet.build();
+ com.google.common.collect.ImmutableSortedSet<String> passes = this.passes == null ? com.google.common.collect.ImmutableSortedSet.<String>of() : this.passes.build();
+ return new BuilderSingularGuavaListsSets<T>(cards, frogs, rawSet, passes);
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder(cards=" + this.cards + ", frogs=" + this.frogs + ", rawSet=" + this.rawSet + ", passes=" + this.passes + ")";
+ }
+ }
+ @java.lang.SuppressWarnings("all")
+ public static <T> BuilderSingularGuavaListsSetsBuilder<T> builder() {
+ return new BuilderSingularGuavaListsSetsBuilder<T>();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java b/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java
new file mode 100644
index 00000000..ab250e3c
--- /dev/null
+++ b/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java
@@ -0,0 +1,76 @@
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableBiMap;
+import com.google.common.collect.ImmutableSortedMap;
+class BuilderSingularGuavaMaps<K, V> {
+ private ImmutableMap<K, V> battleaxes;
+ private ImmutableSortedMap<Integer, ? extends V> vertices;
+ @SuppressWarnings("all")
+ private ImmutableBiMap rawMap;
+ @java.lang.SuppressWarnings("all")
+ BuilderSingularGuavaMaps(final ImmutableMap<K, V> battleaxes, final ImmutableSortedMap<Integer, ? extends V> vertices, final ImmutableBiMap rawMap) {
+ this.battleaxes = battleaxes;
+ this.vertices = vertices;
+ this.rawMap = rawMap;
+ }
+ @java.lang.SuppressWarnings("all")
+ public static class BuilderSingularGuavaMapsBuilder<K, V> {
+ private com.google.common.collect.ImmutableMap.Builder<K, V> battleaxes;
+ private com.google.common.collect.ImmutableSortedMap.Builder<Integer, V> vertices;
+ private com.google.common.collect.ImmutableBiMap.Builder<java.lang.Object, java.lang.Object> rawMap;
+ @java.lang.SuppressWarnings("all")
+ BuilderSingularGuavaMapsBuilder() {
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaMapsBuilder<K, V> battleaxe(final K battleaxe$key, final V battleaxe$value) {
+ if (this.battleaxes == null) this.battleaxes = com.google.common.collect.ImmutableMap.builder();
+ this.battleaxes.put(battleaxe$key, battleaxe$value);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaMapsBuilder<K, V> battleaxes(final java.util.Map<? extends K, ? extends V> battleaxes) {
+ if (this.battleaxes == null) this.battleaxes = com.google.common.collect.ImmutableMap.builder();
+ this.battleaxes.putAll(battleaxes);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaMapsBuilder<K, V> vertex(final Integer vertex$key, final V vertex$value) {
+ if (this.vertices == null) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder();
+ this.vertices.put(vertex$key, vertex$value);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaMapsBuilder<K, V> vertices(final java.util.Map<? extends Integer, ? extends V> vertices) {
+ if (this.vertices == null) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder();
+ this.vertices.putAll(vertices);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaMapsBuilder<K, V> rawMap(final java.lang.Object rawMap$key, final java.lang.Object rawMap$value) {
+ if (this.rawMap == null) this.rawMap = com.google.common.collect.ImmutableBiMap.builder();
+ this.rawMap.put(rawMap$key, rawMap$value);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaMapsBuilder<K, V> rawMap(final java.util.Map<?, ?> rawMap) {
+ if (this.rawMap == null) this.rawMap = com.google.common.collect.ImmutableBiMap.builder();
+ this.rawMap.putAll(rawMap);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularGuavaMaps<K, V> build() {
+ com.google.common.collect.ImmutableMap<K, V> battleaxes = this.battleaxes == null ? com.google.common.collect.ImmutableMap.<K, V>of() : this.battleaxes.build();
+ com.google.common.collect.ImmutableSortedMap<Integer, V> vertices = this.vertices == null ? com.google.common.collect.ImmutableSortedMap.<Integer, V>of() : this.vertices.build();
+ com.google.common.collect.ImmutableBiMap<java.lang.Object, java.lang.Object> rawMap = this.rawMap == null ? com.google.common.collect.ImmutableBiMap.<java.lang.Object, java.lang.Object>of() : this.rawMap.build();
+ return new BuilderSingularGuavaMaps<K, V>(battleaxes, vertices, rawMap);
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "BuilderSingularGuavaMaps.BuilderSingularGuavaMapsBuilder(battleaxes=" + this.battleaxes + ", vertices=" + this.vertices + ", rawMap=" + this.rawMap + ")";
+ }
+ }
+ @java.lang.SuppressWarnings("all")
+ public static <K, V> BuilderSingularGuavaMapsBuilder<K, V> builder() {
+ return new BuilderSingularGuavaMapsBuilder<K, V>();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/BuilderSingularLists.java b/test/transform/resource/after-delombok/BuilderSingularLists.java
new file mode 100644
index 00000000..0d074e92
--- /dev/null
+++ b/test/transform/resource/after-delombok/BuilderSingularLists.java