[i2078] Add possibility to generate assert on @NonNull

This commit is contained in:
Roel Spilker committed 2019-03-26 00:00:42 +01:00
1 parent e4b61e1263
commit 4e7414038a
40 files changed
+261 -163

No files matched your search

@@ -0,0 +1,18 @@
public class NonNullWithAssertion {
private @lombok.NonNull @lombok.Setter String test;
public NonNullWithAssertion() {
super();
}
public void testMethod(@lombok.NonNull String arg) {
assert (arg != null): "arg is marked non-null but is null";
System.out.println(arg);
}
public void testMethodWithIf(@lombok.NonNull String arg) {
if ((arg == null))
throw new NullPointerException("Oops");
}
public @java.lang.SuppressWarnings("all") void setTest(final @lombok.NonNull String test) {
assert (test != null): "test is marked non-null but is null";
this.test = test;
}
}