mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 12:14:31 +00:00
Added confkey to make @NonNull generate a different exception because of the IllegalArgumentException vs. NullPointerException that we really don’t want to get into.
This commit is contained in:
1 parent
57c92478a9
commit
4b878f9ba9
25 files changed
+252
-94
No files matched your search
@@ -0,0 +1,17 @@
|
||||
public class NonNullWithAlternateException {
|
||||
@lombok.NonNull
|
||||
private String test;
|
||||
public void testMethod(@lombok.NonNull String arg) {
|
||||
if (arg == null) {
|
||||
throw new java.lang.IllegalArgumentException("arg");
|
||||
}
|
||||
System.out.println(arg);
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public void setTest(@lombok.NonNull final String test) {
|
||||
if (test == null) {
|
||||
throw new java.lang.IllegalArgumentException("test");
|
||||
}
|
||||
this.test = test;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user