-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 559: NullPointerException when @nonnull is used in abstract method
- Prevent NPE in javac and give a proper warning in both eclipse and javac - Add test cases
- Loading branch information
Showing
8 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
test/transform/resource/after-delombok/NonNullOnParameterAbstract.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
abstract class NonNullOnParameterAbstract { | ||
public void test(@lombok.NonNull String arg) { | ||
if (arg == null) { | ||
throw new java.lang.NullPointerException("arg"); | ||
} | ||
System.out.println("Hey"); | ||
} | ||
|
||
public abstract void test2(@lombok.NonNull String arg); | ||
} |
13 changes: 13 additions & 0 deletions
13
test/transform/resource/after-ecj/NonNullOnParameterAbstract.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
abstract class NonNullOnParameterAbstract { | ||
NonNullOnParameterAbstract() { | ||
super(); | ||
} | ||
public void test(@lombok.NonNull String arg) { | ||
if ((arg == null)) | ||
{ | ||
throw new java.lang.NullPointerException("arg"); | ||
} | ||
System.out.println("Hey"); | ||
} | ||
public abstract void test2(@lombok.NonNull String arg); | ||
} |
7 changes: 7 additions & 0 deletions
7
test/transform/resource/before/NonNullOnParameterAbstract.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
abstract class NonNullOnParameterAbstract { | ||
public void test(@lombok.NonNull String arg) { | ||
System.out.println("Hey"); | ||
} | ||
|
||
public abstract void test2(@lombok.NonNull String arg); | ||
} |
1 change: 1 addition & 0 deletions
1
test/transform/resource/messages-delombok/NonNullOnParameterAbstract.java.messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
6:36 @NonNull is meaningless on a parameter of an abstract method. |
1 change: 1 addition & 0 deletions
1
test/transform/resource/messages-ecj/NonNullOnParameterAbstract.java.messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
6:154 @NonNull is meaningless on a parameter of an abstract method. |
1 change: 1 addition & 0 deletions
1
test/transform/resource/messages-idempotent/NonNullOnParameterAbstract.java.messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9:36 @NonNull is meaningless on a parameter of an abstract method. |