diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-01-20 15:25:08 +0100 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-01-28 16:21:39 +0100 |
commit | e95680a76733c22ee5937a586ee50c703d5ba621 (patch) | |
tree | 3eaefce07c41760468c3c2a17c86297e2304a730 /test | |
parent | fa70b194aa7db62bdbc4cc759a606f97fe50fc92 (diff) | |
download | lombok-e95680a76733c22ee5937a586ee50c703d5ba621.tar.gz lombok-e95680a76733c22ee5937a586ee50c703d5ba621.tar.bz2 lombok-e95680a76733c22ee5937a586ee50c703d5ba621.zip |
[issue #2221] [issue #788] Lombok now adds nullity annotations.
Which 'flavour' is defined in lombok.config; applied to toString, equals, canEqual, and plural-form of `@Singular`.
Diffstat (limited to 'test')
21 files changed, 443 insertions, 71 deletions
diff --git a/test/stubs/org/checkerframework/checker/nullness/qual/NonNull.java b/test/stubs/org/checkerframework/checker/nullness/qual/NonNull.java new file mode 100644 index 00000000..d552f8c7 --- /dev/null +++ b/test/stubs/org/checkerframework/checker/nullness/qual/NonNull.java @@ -0,0 +1,12 @@ +package org.checkerframework.checker.nullness.qual; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +public @interface NonNull {} diff --git a/test/stubs/org/checkerframework/checker/nullness/qual/Nullable.java b/test/stubs/org/checkerframework/checker/nullness/qual/Nullable.java new file mode 100644 index 00000000..d81e3abb --- /dev/null +++ b/test/stubs/org/checkerframework/checker/nullness/qual/Nullable.java @@ -0,0 +1,12 @@ +package org.checkerframework.checker.nullness.qual; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +@Documented +public @interface Nullable {} diff --git a/test/stubs/org/eclipse/jdt/annotation/NonNull.java b/test/stubs/org/eclipse/jdt/annotation/NonNull.java new file mode 100644 index 00000000..be9ad6eb --- /dev/null +++ b/test/stubs/org/eclipse/jdt/annotation/NonNull.java @@ -0,0 +1,12 @@ +package org.eclipse.jdt.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Documented +@Retention(RetentionPolicy.CLASS) +@Target(ElementType.TYPE_USE) +public @interface NonNull {} diff --git a/test/stubs/org/eclipse/jdt/annotation/Nullable.java b/test/stubs/org/eclipse/jdt/annotation/Nullable.java new file mode 100644 index 00000000..d19c54f1 --- /dev/null +++ b/test/stubs/org/eclipse/jdt/annotation/Nullable.java @@ -0,0 +1,12 @@ +package org.eclipse.jdt.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Documented +@Retention(RetentionPolicy.CLASS) +@Target(ElementType.TYPE_USE) +public @interface Nullable {} diff --git a/test/stubs/org/springframework/lang/NonNull.java b/test/stubs/org/springframework/lang/NonNull.java new file mode 100644 index 00000000..b6b16680 --- /dev/null +++ b/test/stubs/org/springframework/lang/NonNull.java @@ -0,0 +1,12 @@ +package org.springframework.lang; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface NonNull {} diff --git a/test/stubs/org/springframework/lang/Nullable.java b/test/stubs/org/springframework/lang/Nullable.java new file mode 100644 index 00000000..94317005 --- /dev/null +++ b/test/stubs/org/springframework/lang/Nullable.java @@ -0,0 +1,12 @@ +package org.springframework.lang; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Nullable {} diff --git a/test/transform/resource/after-delombok/BuilderSingularNullBehavior2.java b/test/transform/resource/after-delombok/BuilderSingularNullBehavior2.java new file mode 100644 index 00000000..f62ebd10 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderSingularNullBehavior2.java @@ -0,0 +1,99 @@ +import java.util.List; +import lombok.Singular.NullCollectionBehavior; +class BuilderSingularNullBehavior2 { + private List<String> locations; + private List<String> doohickeys; + @java.lang.SuppressWarnings("all") + BuilderSingularNullBehavior2(final List<String> locations, final List<String> doohickeys) { + this.locations = locations; + this.doohickeys = doohickeys; + } + @java.lang.SuppressWarnings("all") + public static class BuilderSingularNullBehavior2Builder { + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<String> locations; + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<String> doohickeys; + @java.lang.SuppressWarnings("all") + BuilderSingularNullBehavior2Builder() { + } + @java.lang.SuppressWarnings("all") + public BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder location(final String location) { + if (this.locations == null) this.locations = new java.util.ArrayList<String>(); + this.locations.add(location); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder locations(final java.util.@org.checkerframework.checker.nullness.qual.NonNull Collection<? extends String> locations) { + java.util.Objects.requireNonNull(locations, "locations cannot be null"); + if (this.locations == null) this.locations = new java.util.ArrayList<String>(); + this.locations.addAll(locations); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder clearLocations() { + if (this.locations != null) this.locations.clear(); + return this; + } + + @java.lang.SuppressWarnings("all") + public BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder doohickey(final String doohickey) { + if (this.doohickeys == null) this.doohickeys = new java.util.ArrayList<String>(); + this.doohickeys.add(doohickey); + return this; + } + + @java.lang.SuppressWarnings("all") + public BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder doohickeys(final java.util.@org.checkerframework.checker.nullness.qual.Nullable Collection<? extends String> doohickeys) { + if (doohickeys != null) { + if (this.doohickeys == null) this.doohickeys = new java.util.ArrayList<String>(); + this.doohickeys.addAll(doohickeys); + } + return this; + } + + @java.lang.SuppressWarnings("all") + public BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder clearDoohickeys() { + if (this.doohickeys != null) this.doohickeys.clear(); + return this; + } + + @java.lang.SuppressWarnings("all") + public BuilderSingularNullBehavior2 build() { + java.util.List<String> locations; + switch (this.locations == null ? 0 : this.locations.size()) { + case 0: + locations = java.util.Collections.emptyList(); + break; + case 1: + locations = java.util.Collections.singletonList(this.locations.get(0)); + break; + default: + locations = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.locations)); + } + java.util.List<String> doohickeys; + switch (this.doohickeys == null ? 0 : this.doohickeys.size()) { + case 0: + doohickeys = java.util.Collections.emptyList(); + break; + case 1: + doohickeys = java.util.Collections.singletonList(this.doohickeys.get(0)); + break; + default: + doohickeys = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.doohickeys)); + } + return new BuilderSingularNullBehavior2(locations, doohickeys); + } + + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.@org.checkerframework.checker.nullness.qual.NonNull String toString() { + return "BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder(locations=" + this.locations + ", doohickeys=" + this.doohickeys + ")"; + } + } + + @java.lang.SuppressWarnings("all") + public static BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder builder() { + return new BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithNNBD.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithNNBD.java deleted file mode 100644 index 6eaf9f36..00000000 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeWithNNBD.java +++ /dev/null @@ -1,30 +0,0 @@ -import javax.annotation.ParametersAreNonnullByDefault; - -@ParametersAreNonnullByDefault -class EqualsAndHashCodeWithNNBD { - - @org.eclipse.jdt.annotation.NonNullByDefault - static class Inner { - @java.lang.Override - @java.lang.SuppressWarnings("all") - public boolean equals(final java.lang.@javax.annotation.Nullable @org.eclipse.jdt.annotation.Nullable Object o) { - if (o == this) return true; - if (!(o instanceof EqualsAndHashCodeWithNNBD.Inner)) return false; - final EqualsAndHashCodeWithNNBD.Inner other = (EqualsAndHashCodeWithNNBD.Inner) o; - if (!other.canEqual((java.lang.Object) this)) return false; - return true; - } - - @java.lang.SuppressWarnings("all") - protected boolean canEqual(final java.lang.Object other) { - return other instanceof EqualsAndHashCodeWithNNBD.Inner; - } - - @java.lang.Override - @java.lang.SuppressWarnings("all") - public int hashCode() { - final int result = 1; - return result; - } - } -}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/NullLibrary1.java b/test/transform/resource/after-delombok/NullLibrary1.java new file mode 100644 index 00000000..e426e3d3 --- /dev/null +++ b/test/transform/resource/after-delombok/NullLibrary1.java @@ -0,0 +1,42 @@ +public class NullLibrary1 { + String foo; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.@org.eclipse.jdt.annotation.Nullable Object o) { + if (o == this) return true; + if (!(o instanceof NullLibrary1)) return false; + final NullLibrary1 other = (NullLibrary1) o; + if (!other.canEqual((java.lang.Object) this)) return false; + final java.lang.Object this$foo = this.foo; + final java.lang.Object other$foo = other.foo; + if (this$foo == null ? other$foo != null : !this$foo.equals(other$foo)) return false; + return true; + } + @java.lang.SuppressWarnings("all") + protected boolean canEqual(final java.lang.@org.eclipse.jdt.annotation.Nullable Object other) { + return other instanceof NullLibrary1; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 59; + int result = 1; + final java.lang.Object $foo = this.foo; + result = result * PRIME + ($foo == null ? 43 : $foo.hashCode()); + return result; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.@org.eclipse.jdt.annotation.NonNull String toString() { + return "NullLibrary1(foo=" + this.foo + ")"; + } + @java.lang.SuppressWarnings("all") + public NullLibrary1(final String foo) { + this.foo = foo; + } + @org.eclipse.jdt.annotation.NonNull + @java.lang.SuppressWarnings("all") + public NullLibrary1 withFoo(final String foo) { + return this.foo == foo ? this : new NullLibrary1(foo); + } +} diff --git a/test/transform/resource/after-delombok/NullLibrary2.java b/test/transform/resource/after-delombok/NullLibrary2.java new file mode 100644 index 00000000..8f48c8a5 --- /dev/null +++ b/test/transform/resource/after-delombok/NullLibrary2.java @@ -0,0 +1,43 @@ +public class NullLibrary2 { + String foo; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(@org.springframework.lang.Nullable final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof NullLibrary2)) return false; + final NullLibrary2 other = (NullLibrary2) o; + if (!other.canEqual((java.lang.Object) this)) return false; + final java.lang.Object this$foo = this.foo; + final java.lang.Object other$foo = other.foo; + if (this$foo == null ? other$foo != null : !this$foo.equals(other$foo)) return false; + return true; + } + @java.lang.SuppressWarnings("all") + protected boolean canEqual(@org.springframework.lang.Nullable final java.lang.Object other) { + return other instanceof NullLibrary2; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 59; + int result = 1; + final java.lang.Object $foo = this.foo; + result = result * PRIME + ($foo == null ? 43 : $foo.hashCode()); + return result; + } + @org.springframework.lang.NonNull + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "NullLibrary2(foo=" + this.foo + ")"; + } + @java.lang.SuppressWarnings("all") + public NullLibrary2(final String foo) { + this.foo = foo; + } + @org.springframework.lang.NonNull + @java.lang.SuppressWarnings("all") + public NullLibrary2 withFoo(final String foo) { + return this.foo == foo ? this : new NullLibrary2(foo); + } +} diff --git a/test/transform/resource/after-ecj/BuilderSingularNullBehavior2.java b/test/transform/resource/after-ecj/BuilderSingularNullBehavior2.java new file mode 100644 index 00000000..308a5174 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderSingularNullBehavior2.java @@ -0,0 +1,88 @@ +import java.util.List; +import lombok.Singular; +import lombok.Singular.NullCollectionBehavior; +@lombok.Builder class BuilderSingularNullBehavior2 { + public static @java.lang.SuppressWarnings("all") class BuilderSingularNullBehavior2Builder { + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> locations; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> doohickeys; + @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior2Builder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder location(final String location) { + if ((this.locations == null)) + this.locations = new java.util.ArrayList<String>(); + this.locations.add(location); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder locations(final java.util. @org.checkerframework.checker.nullness.qual.NonNull Collection<? extends String> locations) { + java.util.Objects.requireNonNull(locations, "locations cannot be null"); + if ((this.locations == null)) + this.locations = new java.util.ArrayList<String>(); + this.locations.addAll(locations); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder clearLocations() { + if ((this.locations != null)) + this.locations.clear(); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder doohickey(final String doohickey) { + if ((this.doohickeys == null)) + this.doohickeys = new java.util.ArrayList<String>(); + this.doohickeys.add(doohickey); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder doohickeys(final java.util. @org.checkerframework.checker.nullness.qual.Nullable Collection<? extends String> doohickeys) { + if ((doohickeys != null)) + { + if ((this.doohickeys == null)) + this.doohickeys = new java.util.ArrayList<String>(); + this.doohickeys.addAll(doohickeys); + } + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder clearDoohickeys() { + if ((this.doohickeys != null)) + this.doohickeys.clear(); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior2 build() { + java.util.List<String> locations; + switch (((this.locations == null) ? 0 : this.locations.size())) { + case 0 : + locations = java.util.Collections.emptyList(); + break; + case 1 : + locations = java.util.Collections.singletonList(this.locations.get(0)); + break; + default : + locations = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.locations)); + } + java.util.List<String> doohickeys; + switch (((this.doohickeys == null) ? 0 : this.doohickeys.size())) { + case 0 : + doohickeys = java.util.Collections.emptyList(); + break; + case 1 : + doohickeys = java.util.Collections.singletonList(this.doohickeys.get(0)); + break; + default : + doohickeys = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.doohickeys)); + } + return new BuilderSingularNullBehavior2(locations, doohickeys); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.@org.checkerframework.checker.nullness.qual.NonNull String toString() { + return (((("BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder(locations=" + this.locations) + ", doohickeys=") + this.doohickeys) + ")"); + } + } + private @Singular(nullBehavior = Singular.NullCollectionBehavior.JDK) List<String> locations; + private @Singular(nullBehavior = lombok.Singular.NullCollectionBehavior.IGNORE) List<String> doohickeys; + @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior2(final List<String> locations, final List<String> doohickeys) { + super(); + this.locations = locations; + this.doohickeys = doohickeys; + } + public static @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder builder() { + return new BuilderSingularNullBehavior2.BuilderSingularNullBehavior2Builder(); + } +} diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeWithNNBD.java b/test/transform/resource/after-ecj/EqualsAndHashCodeWithNNBD.java deleted file mode 100644 index 4781839d..00000000 --- a/test/transform/resource/after-ecj/EqualsAndHashCodeWithNNBD.java +++ /dev/null @@ -1,28 +0,0 @@ -import javax.annotation.ParametersAreNonnullByDefault; -@ParametersAreNonnullByDefault class EqualsAndHashCodeWithNNBD { - static @lombok.EqualsAndHashCode @org.eclipse.jdt.annotation.NonNullByDefault class Inner { - Inner() { - super(); - } - public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.@javax.annotation.Nullable @org.eclipse.jdt.annotation.Nullable Object o) { - if ((o == this)) - return true; - if ((! (o instanceof EqualsAndHashCodeWithNNBD.Inner))) - return false; - final EqualsAndHashCodeWithNNBD.Inner other = (EqualsAndHashCodeWithNNBD.Inner) o; - if ((! other.canEqual((java.lang.Object) this))) - return false; - return true; - } - protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { - return (other instanceof EqualsAndHashCodeWithNNBD.Inner); - } - public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int result = 1; - return result; - } - } - EqualsAndHashCodeWithNNBD() { - super(); - } -}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/NullLibrary1.java b/test/transform/resource/after-ecj/NullLibrary1.java new file mode 100644 index 00000000..baea9e7a --- /dev/null +++ b/test/transform/resource/after-ecj/NullLibrary1.java @@ -0,0 +1,37 @@ +public @lombok.EqualsAndHashCode @lombok.ToString @lombok.AllArgsConstructor class NullLibrary1 { + @lombok.With String foo; + public @org.eclipse.jdt.annotation.NonNull @java.lang.SuppressWarnings("all") NullLibrary1 withFoo(final String foo) { + return ((this.foo == foo) ? this : new NullLibrary1(foo)); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.@org.eclipse.jdt.annotation.Nullable Object o) { + if ((o == this)) + return true; + if ((! (o instanceof NullLibrary1))) + return false; + final NullLibrary1 other = (NullLibrary1) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + final java.lang.Object this$foo = this.foo; + final java.lang.Object other$foo = other.foo; + if (((this$foo == null) ? (other$foo != null) : (! this$foo.equals(other$foo)))) + return false; + return true; + } + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.@org.eclipse.jdt.annotation.Nullable Object other) { + return (other instanceof NullLibrary1); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 59; + int result = 1; + final java.lang.Object $foo = this.foo; + result = ((result * PRIME) + (($foo == null) ? 43 : $foo.hashCode())); + return result; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.@org.eclipse.jdt.annotation.NonNull String toString() { + return (("NullLibrary1(foo=" + this.foo) + ")"); + } + public @java.lang.SuppressWarnings("all") NullLibrary1(final String foo) { + super(); + this.foo = foo; + } +} diff --git a/test/transform/resource/after-ecj/NullLibrary2.java b/test/transform/resource/after-ecj/NullLibrary2.java new file mode 100644 index 00000000..60ad103f --- /dev/null +++ b/test/transform/resource/after-ecj/NullLibrary2.java @@ -0,0 +1,37 @@ +public @lombok.EqualsAndHashCode @lombok.ToString @lombok.AllArgsConstructor class NullLibrary2 { + @lombok.With String foo; + public @org.springframework.lang.NonNull @java.lang.SuppressWarnings("all") NullLibrary2 withFoo(final String foo) { + return ((this.foo == foo) ? this : new NullLibrary2(foo)); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final @org.springframework.lang.Nullable java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof NullLibrary2))) + return false; + final NullLibrary2 other = (NullLibrary2) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + final java.lang.Object this$foo = this.foo; + final java.lang.Object other$foo = other.foo; + if (((this$foo == null) ? (other$foo != null) : (! this$foo.equals(other$foo)))) + return false; + return true; + } + protected @java.lang.SuppressWarnings("all") boolean canEqual(final @org.springframework.lang.Nullable java.lang.Object other) { + return (other instanceof NullLibrary2); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 59; + int result = 1; + final java.lang.Object $foo = this.foo; + result = ((result * PRIME) + (($foo == null) ? 43 : $foo.hashCode())); + return result; + } + public @java.lang.Override @org.springframework.lang.NonNull @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (("NullLibrary2(foo=" + this.foo) + ")"); + } + public @java.lang.SuppressWarnings("all") NullLibrary2(final String foo) { + super(); + this.foo = foo; + } +} diff --git a/test/transform/resource/before/BuilderSingularNullBehavior2.java b/test/transform/resource/before/BuilderSingularNullBehavior2.java new file mode 100644 index 00000000..720cf5a8 --- /dev/null +++ b/test/transform/resource/before/BuilderSingularNullBehavior2.java @@ -0,0 +1,11 @@ +//CONF: lombok.addNullAnnotations = checkerframework +import java.util.List; + +import lombok.Singular; +import lombok.Singular.NullCollectionBehavior; + +@lombok.Builder +class BuilderSingularNullBehavior2 { + @Singular(nullBehavior = Singular.NullCollectionBehavior.JDK) private List<String> locations; + @Singular(nullBehavior = lombok.Singular.NullCollectionBehavior.IGNORE) private List<String> doohickeys; +} diff --git a/test/transform/resource/before/EqualsAndHashCodeWithNNBD.java b/test/transform/resource/before/EqualsAndHashCodeWithNNBD.java deleted file mode 100644 index dc86cb55..00000000 --- a/test/transform/resource/before/EqualsAndHashCodeWithNNBD.java +++ /dev/null @@ -1,8 +0,0 @@ -// version 8: -import javax.annotation.ParametersAreNonnullByDefault; -@ParametersAreNonnullByDefault -class EqualsAndHashCodeWithNNBD { - @lombok.EqualsAndHashCode @org.eclipse.jdt.annotation.NonNullByDefault - static class Inner { - } -} diff --git a/test/transform/resource/before/NullLibrary1.java b/test/transform/resource/before/NullLibrary1.java new file mode 100644 index 00000000..95433270 --- /dev/null +++ b/test/transform/resource/before/NullLibrary1.java @@ -0,0 +1,7 @@ +//CONF: lombok.addNullAnnotations = eclipse +@lombok.EqualsAndHashCode +@lombok.ToString +@lombok.AllArgsConstructor +public class NullLibrary1 { + @lombok.With String foo; +} diff --git a/test/transform/resource/before/NullLibrary2.java b/test/transform/resource/before/NullLibrary2.java new file mode 100644 index 00000000..17b1e6e0 --- /dev/null +++ b/test/transform/resource/before/NullLibrary2.java @@ -0,0 +1,7 @@ +//CONF: lombok.addNullAnnotations = spring +@lombok.EqualsAndHashCode +@lombok.ToString +@lombok.AllArgsConstructor +public class NullLibrary2 { + @lombok.With String foo; +} diff --git a/test/transform/resource/messages-delombok/EqualsAndHashCodeWithNNBD.java.messages b/test/transform/resource/messages-delombok/EqualsAndHashCodeWithNNBD.java.messages deleted file mode 100644 index 31259a51..00000000 --- a/test/transform/resource/messages-delombok/EqualsAndHashCodeWithNNBD.java.messages +++ /dev/null @@ -1 +0,0 @@ -5 package org.eclipse.jdt.annotation does not exist diff --git a/test/transform/resource/messages-ecj/EqualsAndHashCodeWithNNBD.java.messages b/test/transform/resource/messages-ecj/EqualsAndHashCodeWithNNBD.java.messages deleted file mode 100644 index 8fa7c194..00000000 --- a/test/transform/resource/messages-ecj/EqualsAndHashCodeWithNNBD.java.messages +++ /dev/null @@ -1 +0,0 @@ -2 The import javax.annotation.ParametersAreNonnullByDefault cannot be resolved diff --git a/test/transform/resource/messages-idempotent/EqualsAndHashCodeWithNNBD.java.messages b/test/transform/resource/messages-idempotent/EqualsAndHashCodeWithNNBD.java.messages deleted file mode 100644 index 15b05f9c..00000000 --- a/test/transform/resource/messages-idempotent/EqualsAndHashCodeWithNNBD.java.messages +++ /dev/null @@ -1,3 +0,0 @@ -6 package org.eclipse.jdt.annotation does not exist -10 package org.eclipse.jdt.annotation does not exist -10 annotation not applicabl |