From f650e32f54c5f0c3b535ab0fd54098645ad23818 Mon Sep 17 00:00:00 2001 From: "mp.samoylych" Date: Tue, 16 Jan 2024 12:26:37 +0300 Subject: [PATCH] Test ecj --- buildScripts/tests.ant.xml | 2 +- .../BuilderSingularSequencedCollections.java | 132 ++++++++++++++++++ ...SingularSequencedCollections.java.messages | 12 ++ 3 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 test/transform/resource/after-ecj/BuilderSingularSequencedCollections.java create mode 100644 test/transform/resource/messages-ecj/BuilderSingularSequencedCollections.java.messages diff --git a/buildScripts/tests.ant.xml b/buildScripts/tests.ant.xml index 630bac42e..ade6fbffe 100644 --- a/buildScripts/tests.ant.xml +++ b/buildScripts/tests.ant.xml @@ -220,7 +220,7 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn - + diff --git a/test/transform/resource/after-ecj/BuilderSingularSequencedCollections.java b/test/transform/resource/after-ecj/BuilderSingularSequencedCollections.java new file mode 100644 index 000000000..5c477ff45 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderSingularSequencedCollections.java @@ -0,0 +1,132 @@ +// version 21: +import java.util.SequencedCollection; +import java.util.SequencedMap; +import java.util.SequencedSet; +import lombok.Builder; +import lombok.Singular; +@Builder class BuilderSingularSequencedCollections { + public static @java.lang.SuppressWarnings("all") class BuilderSingularSequencedCollectionsBuilder { + private @java.lang.SuppressWarnings("all") java.util.ArrayList sequencedCollection; + private @java.lang.SuppressWarnings("all") java.util.ArrayList sequencedMap$key; + private @java.lang.SuppressWarnings("all") java.util.ArrayList sequencedMap$value; + private @java.lang.SuppressWarnings("all") java.util.ArrayList sequencedSet; + @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollectionsBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollections.BuilderSingularSequencedCollectionsBuilder col(final T col) { + if ((this.sequencedCollection == null)) + this.sequencedCollection = new java.util.ArrayList(); + this.sequencedCollection.add(col); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollections.BuilderSingularSequencedCollectionsBuilder sequencedCollection(final java.util.Collection sequencedCollection) { + if ((sequencedCollection == null)) + { + throw new java.lang.NullPointerException("sequencedCollection cannot be null"); + } + if ((this.sequencedCollection == null)) + this.sequencedCollection = new java.util.ArrayList(); + this.sequencedCollection.addAll(sequencedCollection); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollections.BuilderSingularSequencedCollectionsBuilder clearSequencedCollection() { + if ((this.sequencedCollection != null)) + this.sequencedCollection.clear(); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollections.BuilderSingularSequencedCollectionsBuilder map(final K mapKey, final V mapValue) { + if ((this.sequencedMap$key == null)) + { + this.sequencedMap$key = new java.util.ArrayList(); + this.sequencedMap$value = new java.util.ArrayList(); + } + this.sequencedMap$key.add(mapKey); + this.sequencedMap$value.add(mapValue); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollections.BuilderSingularSequencedCollectionsBuilder sequencedMap(final java.util.Map sequencedMap) { + if ((sequencedMap == null)) + { + throw new java.lang.NullPointerException("sequencedMap cannot be null"); + } + if ((this.sequencedMap$key == null)) + { + this.sequencedMap$key = new java.util.ArrayList(); + this.sequencedMap$value = new java.util.ArrayList(); + } + for (java.util.Map.Entry $lombokEntry : sequencedMap.entrySet()) + { + this.sequencedMap$key.add($lombokEntry.getKey()); + this.sequencedMap$value.add($lombokEntry.getValue()); + } + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollections.BuilderSingularSequencedCollectionsBuilder clearSequencedMap() { + if ((this.sequencedMap$key != null)) + { + this.sequencedMap$key.clear(); + this.sequencedMap$value.clear(); + } + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollections.BuilderSingularSequencedCollectionsBuilder set(final T set) { + if ((this.sequencedSet == null)) + this.sequencedSet = new java.util.ArrayList(); + this.sequencedSet.add(set); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollections.BuilderSingularSequencedCollectionsBuilder sequencedSet(final java.util.Collection sequencedSet) { + if ((sequencedSet == null)) + { + throw new java.lang.NullPointerException("sequencedSet cannot be null"); + } + if ((this.sequencedSet == null)) + this.sequencedSet = new java.util.ArrayList(); + this.sequencedSet.addAll(sequencedSet); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollections.BuilderSingularSequencedCollectionsBuilder clearSequencedSet() { + if ((this.sequencedSet != null)) + this.sequencedSet.clear(); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollections build() { + java.util.SequencedCollection sequencedCollection; + switch (((this.sequencedCollection == null) ? 0 : this.sequencedCollection.size())) { + case 0 : + sequencedCollection = java.util.Collections.emptyList(); + break; + case 1 : + sequencedCollection = java.util.Collections.singletonList(this.sequencedCollection.get(0)); + break; + default : + sequencedCollection = java.util.Collections.unmodifiableList(new java.util.ArrayList(this.sequencedCollection)); + } + java.util.SequencedMap sequencedMap = new java.util.LinkedHashMap(); + if ((this.sequencedMap$key != null)) + for (int $i = 0;; ($i < ((this.sequencedMap$key == null) ? 0 : this.sequencedMap$key.size())); $i ++) + sequencedMap.put(this.sequencedMap$key.get($i), this.sequencedMap$value.get($i)); + sequencedMap = java.util.Collections.unmodifiableSequencedMap(sequencedMap); + java.util.SequencedSet sequencedSet = new java.util.LinkedHashSet(); + if ((this.sequencedSet != null)) + sequencedSet.addAll(this.sequencedSet); + sequencedSet = java.util.Collections.unmodifiableSequencedSet(sequencedSet); + return new BuilderSingularSequencedCollections(sequencedCollection, sequencedMap, sequencedSet); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((((("BuilderSingularSequencedCollections.BuilderSingularSequencedCollectionsBuilder(sequencedCollection=" + this.sequencedCollection) + ", sequencedMap$key=") + this.sequencedMap$key) + ", sequencedMap$value=") + this.sequencedMap$value) + ", sequencedSet=") + this.sequencedSet) + ")"); + } + } + private @Singular("col") SequencedCollection sequencedCollection; + private @Singular("map") SequencedMap sequencedMap; + private @Singular("set") SequencedSet sequencedSet; + @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollections(final SequencedCollection sequencedCollection, final SequencedMap sequencedMap, final SequencedSet sequencedSet) { + super(); + this.sequencedCollection = sequencedCollection; + this.sequencedMap = sequencedMap; + this.sequencedSet = sequencedSet; + } + public static @java.lang.SuppressWarnings("all") BuilderSingularSequencedCollections.BuilderSingularSequencedCollectionsBuilder builder() { + return new BuilderSingularSequencedCollections.BuilderSingularSequencedCollectionsBuilder(); + } +} \ No newline at end of file diff --git a/test/transform/resource/messages-ecj/BuilderSingularSequencedCollections.java.messages b/test/transform/resource/messages-ecj/BuilderSingularSequencedCollections.java.messages new file mode 100644 index 000000000..915eaabf9 --- /dev/null +++ b/test/transform/resource/messages-ecj/BuilderSingularSequencedCollections.java.messages @@ -0,0 +1,12 @@ +3 The import java.util.SequencedCollection cannot be resolved +4 The import java.util.SequencedMap cannot be resolved +5 The import java.util.SequencedSet cannot be resolved +10 SequencedCollection cannot be resolved to a type +10 SequencedMap cannot be resolved to a type +10 SequencedSet cannot be resolved to a type +10 java.util.SequencedCollection cannot be resolved to a type +10 java.util.SequencedMap cannot be resolved to a type +10 java.util.SequencedSet cannot be resolved to a type +12 SequencedCollection cannot be resolved to a type +13 SequencedMap cannot be resolved to a type +14 SequencedSet cannot be resolved to a type \ No newline at end of file