aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/before
diff options
context:
space:
mode:
authorCaleb Brinkman <cbrinkman@sonatype.com>2019-07-16 10:39:54 -0500
committerCaleb Brinkman <cbrinkman@sonatype.com>2019-07-16 10:39:54 -0500
commit4dc5c32d6b47264b5c8abb6fdf24077eec5aa7e7 (patch)
tree9779fbf1d16dab92b0f5076f773870653de49820 /test/transform/resource/before
parent88bf742e3e107cc0bbfc3a72c2f456d34ef3079c (diff)
parent218f28cc95ee30d5d362c3ac9d5440c2f86fd712 (diff)
downloadlombok-4dc5c32d6b47264b5c8abb6fdf24077eec5aa7e7.tar.gz
lombok-4dc5c32d6b47264b5c8abb6fdf24077eec5aa7e7.tar.bz2
lombok-4dc5c32d6b47264b5c8abb6fdf24077eec5aa7e7.zip
Merge branch 'master' of github.com:rzwitserloot/lombok into feature/builder-setter-prefixes
Diffstat (limited to 'test/transform/resource/before')
-rw-r--r--test/transform/resource/before/JacksonJsonProperty.java3
-rw-r--r--test/transform/resource/before/NonNullWithGuava.java33
-rw-r--r--test/transform/resource/before/NonNullWithJdk.java34
3 files changed, 70 insertions, 0 deletions
diff --git a/test/transform/resource/before/JacksonJsonProperty.java b/test/transform/resource/before/JacksonJsonProperty.java
index f002dc48..f0b7b2f2 100644
--- a/test/transform/resource/before/JacksonJsonProperty.java
+++ b/test/transform/resource/before/JacksonJsonProperty.java
@@ -1,10 +1,13 @@
import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonSetter;
+import com.fasterxml.jackson.annotation.Nulls;
import lombok.Builder;
import lombok.Setter;
@Builder
public class JacksonJsonProperty {
@JsonProperty("kebab-case-prop")
+ @JsonSetter(nulls = Nulls.SKIP)
@Setter
public String kebabCaseProp;
}
diff --git a/test/transform/resource/before/NonNullWithGuava.java b/test/transform/resource/before/NonNullWithGuava.java
new file mode 100644
index 00000000..dc877daa
--- /dev/null
+++ b/test/transform/resource/before/NonNullWithGuava.java
@@ -0,0 +1,33 @@
+//CONF: lombok.nonNull.exceptionType = Guava
+import static com.google.common.base.Preconditions.*;
+public class NonNullWithGuava {
+ @lombok.NonNull @lombok.Setter private String test;
+
+ public void testMethod(@lombok.NonNull String arg) {
+ System.out.println(arg);
+ }
+
+ public void testMethodWithCheck1(@lombok.NonNull String arg) {
+ checkNotNull(arg);
+ }
+
+ public void testMethodWithCheckAssign(@lombok.NonNull String arg) {
+ test = checkNotNull(arg);
+ }
+
+ public void testMethodWithCheck2(@lombok.NonNull String arg) {
+ com.google.common.base.Preconditions.checkNotNull(arg);
+ }
+
+ public void testMethodWithFakeCheck1(@lombok.NonNull String arg) {
+ checkNotNull("");
+ }
+
+ public void testMethodWithFakeCheck2(@lombok.NonNull String arg) {
+ com.google.common.base.Preconditions.checkNotNull(test);
+ }
+
+ public void testMethodWithFakeCheckAssign(@lombok.NonNull String arg) {
+ test = checkNotNull(test);
+ }
+}
diff --git a/test/transform/resource/before/NonNullWithJdk.java b/test/transform/resource/before/NonNullWithJdk.java
new file mode 100644
index 00000000..c8cbf2ee
--- /dev/null
+++ b/test/transform/resource/before/NonNullWithJdk.java
@@ -0,0 +1,34 @@
+//version 7:
+//CONF: lombok.nonNull.exceptionType = Jdk
+import static java.util.Objects.*;
+public class NonNullWithJdk {
+ @lombok.NonNull @lombok.Setter private String test;
+
+ public void testMethod(@lombok.NonNull String arg) {
+ System.out.println(arg);
+ }
+
+ public void testMethodWithCheck1(@lombok.NonNull String arg) {
+ requireNonNull(arg);
+ }
+
+ public void testMethodWithCheckAssign(@lombok.NonNull String arg) {
+ test = requireNonNull(arg);
+ }
+
+ public void testMethodWithCheck2(@lombok.NonNull String arg) {
+ java.util.Objects.requireNonNull(arg);
+ }
+
+ public void testMethodWithFakeCheck1(@lombok.NonNull String arg) {
+ requireNonNull("");
+ }
+
+ public void testMethodWithFakeCheck2(@lombok.NonNull String arg) {
+ java.util.Objects.requireNonNull(test);
+ }
+
+ public void testMethodWithFakeCheckAssign(@lombok.NonNull String arg) {
+ test = requireNonNull(test);
+ }
+}