From 4618097d986f08a922191332c87a7d8c73e34f96 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 5 Jan 2015 05:39:35 +0100 Subject: @Singleton for j.u.Sets works in javac. --- .../resource/after-delombok/BuilderSingletons.java | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 test/transform/resource/after-delombok/BuilderSingletons.java (limited to 'test/transform/resource/after-delombok/BuilderSingletons.java') diff --git a/test/transform/resource/after-delombok/BuilderSingletons.java b/test/transform/resource/after-delombok/BuilderSingletons.java new file mode 100644 index 00000000..049af0a4 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderSingletons.java @@ -0,0 +1,90 @@ +import java.util.Set; +import java.util.SortedSet; +class BuilderSingletons { + private Set dangerMice; + private SortedSet octopodes; + private Set rawSet; + private Set stringSet; + @java.lang.SuppressWarnings("all") + BuilderSingletons(final Set dangerMice, final SortedSet octopodes, final Set rawSet, final Set stringSet) { + this.dangerMice = dangerMice; + this.octopodes = octopodes; + this.rawSet = rawSet; + this.stringSet = stringSet; + } + @java.lang.SuppressWarnings("all") + public static class BuilderSingletonsBuilder { + private java.util.ArrayList dangerMice; + private java.util.ArrayList octopodes; + private java.util.ArrayList rawSet; + private java.util.ArrayList stringSet; + @java.lang.SuppressWarnings("all") + BuilderSingletonsBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder dangerMouse(final T dangerMouse) { + this.dangerMice.add(dangerMouse); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder dangerMice(final java.util.Collection dangerMice) { + this.dangerMice.addAll(dangerMice); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder octopus(final Number octopus) { + this.octopodes.add(octopus); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder octopodes(final java.util.Collection octopodes) { + this.octopodes.addAll(octopodes); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder rawSet(final java.lang.Object rawSet) { + this.rawSet.add(rawSet); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder rawSet(final java.util.Collection rawSet) { + this.rawSet.addAll(rawSet); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder stringSet(final String stringSet) { + this.stringSet.add(stringSet); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletonsBuilder stringSet(final java.util.Collection stringSet) { + this.stringSet.addAll(stringSet); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingletons build() { + java.util.Set dangerMice = new java.util.LinkedHashSet(this.dangerMice.size() < 1073741824 ? this.dangerMice.size() < 3 ? this.dangerMice.size() + 1 : this.dangerMice.size() + this.dangerMice.size() / 3 : java.lang.Integer.MAX_VALUE, 0.75F); + dangerMice.addAll(this.dangerMice); + dangerMice = java.util.Collections.unmodifiableSet(dangerMice); + java.util.SortedSet octopodes = new java.util.TreeSet(); + octopodes.addAll(this.octopodes); + octopodes = java.util.Collections.unmodifiableSortedSet(octopodes); + java.util.Set rawSet = new java.util.LinkedHashSet(this.rawSet.size() < 1073741824 ? this.rawSet.size() < 3 ? this.rawSet.size() + 1 : this.rawSet.size() + this.rawSet.size() / 3 : java.lang.Integer.MAX_VALUE, 0.75F); + rawSet.addAll(this.rawSet); + rawSet = java.util.Collections.unmodifiableSet(rawSet); + java.util.Set stringSet = new java.util.LinkedHashSet(this.stringSet.size() < 1073741824 ? this.stringSet.size() < 3 ? this.stringSet.size() + 1 : this.stringSet.size() + this.stringSet.size() / 3 : java.lang.Integer.MAX_VALUE, 0.75F); + stringSet.addAll(this.stringSet); + stringSet = java.util.Collections.unmodifiableSet(stringSet); + return new BuilderSingletons(dangerMice, octopodes, rawSet, stringSet); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderSingletons.BuilderSingletonsBuilder(dangerMice=" + this.dangerMice + ", octopodes=" + this.octopodes + ", rawSet=" + this.rawSet + ", stringSet=" + this.stringSet + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderSingletonsBuilder builder() { + return new BuilderSingletonsBuilder(); + } +} \ No newline at end of file -- cgit