From e94a5f9ee3e003c6b889168796bc010072177d14 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 5 Oct 2015 21:58:00 +0200 Subject: [Fixes #807] The NonNull annotation can now be used documentary style on params of abstract methods. The warning has been eliminated. --- .../after-delombok/NonNullOnParameterOfDefaultMethod.java | 9 +++++++++ .../resource/after-ecj/NonNullOnParameterOfDefaultMethod.java | 10 ++++++++++ .../resource/before/NonNullOnParameterOfDefaultMethod.java | 6 ++++++ .../messages-delombok/NonNullOnParameterAbstract.java.messages | 1 - .../messages-ecj/NonNullOnParameterAbstract.java.messages | 1 - .../NonNullOnParameterAbstract.java.messages | 1 - 6 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 test/transform/resource/after-delombok/NonNullOnParameterOfDefaultMethod.java create mode 100644 test/transform/resource/after-ecj/NonNullOnParameterOfDefaultMethod.java create mode 100644 test/transform/resource/before/NonNullOnParameterOfDefaultMethod.java delete mode 100644 test/transform/resource/messages-delombok/NonNullOnParameterAbstract.java.messages delete mode 100644 test/transform/resource/messages-ecj/NonNullOnParameterAbstract.java.messages delete mode 100644 test/transform/resource/messages-idempotent/NonNullOnParameterAbstract.java.messages (limited to 'test') diff --git a/test/transform/resource/after-delombok/NonNullOnParameterOfDefaultMethod.java b/test/transform/resource/after-delombok/NonNullOnParameterOfDefaultMethod.java new file mode 100644 index 00000000..cffff320 --- /dev/null +++ b/test/transform/resource/after-delombok/NonNullOnParameterOfDefaultMethod.java @@ -0,0 +1,9 @@ +interface NonNullOnParameterOfDefaultMethod { + void test(@lombok.NonNull String arg); + default void test2(@lombok.NonNull String arg) { + if (arg == null) { + throw new java.lang.NullPointerException("arg"); + } + System.out.println(arg); + } +} diff --git a/test/transform/resource/after-ecj/NonNullOnParameterOfDefaultMethod.java b/test/transform/resource/after-ecj/NonNullOnParameterOfDefaultMethod.java new file mode 100644 index 00000000..85e99702 --- /dev/null +++ b/test/transform/resource/after-ecj/NonNullOnParameterOfDefaultMethod.java @@ -0,0 +1,10 @@ +interface NonNullOnParameterOfDefaultMethod { + void test(@lombok.NonNull String arg); + default void test2(@lombok.NonNull String arg) { + if ((arg == null)) + { + throw new java.lang.NullPointerException("arg"); + } + System.out.println(arg); + } +} diff --git a/test/transform/resource/before/NonNullOnParameterOfDefaultMethod.java b/test/transform/resource/before/NonNullOnParameterOfDefaultMethod.java new file mode 100644 index 00000000..3b35e90e --- /dev/null +++ b/test/transform/resource/before/NonNullOnParameterOfDefaultMethod.java @@ -0,0 +1,6 @@ +interface NonNullOnParameterOfDefaultMethod { + void test(@lombok.NonNull String arg); + default void test2(@lombok.NonNull String arg) { + System.out.println(arg); + } +} diff --git a/test/transform/resource/messages-delombok/NonNullOnParameterAbstract.java.messages b/test/transform/resource/messages-delombok/NonNullOnParameterAbstract.java.messages deleted file mode 100644 index fd5bffd5..00000000 --- a/test/transform/resource/messages-delombok/NonNullOnParameterAbstract.java.messages +++ /dev/null @@ -1 +0,0 @@ -6 @NonNull is meaningless on a parameter of an abstract method. diff --git a/test/transform/resource/messages-ecj/NonNullOnParameterAbstract.java.messages b/test/transform/resource/messages-ecj/NonNullOnParameterAbstract.java.messages deleted file mode 100644 index 8eb312ef..00000000 --- a/test/transform/resource/messages-ecj/NonNullOnParameterAbstract.java.messages +++ /dev/null @@ -1 +0,0 @@ -6 @NonNull is meaningless on a parameter of an abstract method. \ No newline at end of file diff --git a/test/transform/resource/messages-idempotent/NonNullOnParameterAbstract.java.messages b/test/transform/resource/messages-idempotent/NonNullOnParameterAbstract.java.messages deleted file mode 100644 index 0d9fcfdc..00000000 --- a/test/transform/resource/messages-idempotent/NonNullOnParameterAbstract.java.messages +++ /dev/null @@ -1 +0,0 @@ -9 @NonNull is meaningless on a parameter of an abstract method. \ No newline at end of file -- cgit