From 713822db9894cf99184aff57b3387f99846aa870 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 27 May 2014 20:29:54 +0200 Subject: Changed the lombok.nonNull.exceptionType configkey to be an enum, partly to enforce only sensible exceptions and partly to make it possible to have the message be ‘x is null’ when throwing IAEs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/after-delombok/NonNullWithAlternateException.java | 4 ++-- .../resource/after-ecj/NonNullWithAlternateException.java | 4 ++-- test/transform/resource/before/NonNullWithAlternateException.java | 2 +- test/transform/resource/before/NonNullWithMistypedException.java | 7 ------- .../messages-delombok/NonNullWithMistypedException.java.messages | 1 - .../messages-ecj/NonNullWithMistypedException.java.messages | 1 - 6 files changed, 5 insertions(+), 14 deletions(-) delete mode 100644 test/transform/resource/before/NonNullWithMistypedException.java delete mode 100644 test/transform/resource/messages-delombok/NonNullWithMistypedException.java.messages delete mode 100644 test/transform/resource/messages-ecj/NonNullWithMistypedException.java.messages (limited to 'test/transform') diff --git a/test/transform/resource/after-delombok/NonNullWithAlternateException.java b/test/transform/resource/after-delombok/NonNullWithAlternateException.java index d4a2f657..686a1219 100644 --- a/test/transform/resource/after-delombok/NonNullWithAlternateException.java +++ b/test/transform/resource/after-delombok/NonNullWithAlternateException.java @@ -3,14 +3,14 @@ public class NonNullWithAlternateException { private String test; public void testMethod(@lombok.NonNull String arg) { if (arg == null) { - throw new java.lang.IllegalArgumentException("arg"); + throw new java.lang.IllegalArgumentException("arg is null"); } 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"); + throw new java.lang.IllegalArgumentException("test is null"); } this.test = test; } diff --git a/test/transform/resource/after-ecj/NonNullWithAlternateException.java b/test/transform/resource/after-ecj/NonNullWithAlternateException.java index 43edeb8c..8a547ecf 100644 --- a/test/transform/resource/after-ecj/NonNullWithAlternateException.java +++ b/test/transform/resource/after-ecj/NonNullWithAlternateException.java @@ -6,14 +6,14 @@ public class NonNullWithAlternateException { public void testMethod(@lombok.NonNull String arg) { if ((arg == null)) { - throw new java.lang.IllegalArgumentException("arg"); + throw new java.lang.IllegalArgumentException("arg is null"); } System.out.println(arg); } public @java.lang.SuppressWarnings("all") void setTest(final @lombok.NonNull String test) { if ((test == null)) { - throw new java.lang.IllegalArgumentException("test"); + throw new java.lang.IllegalArgumentException("test is null"); } this.test = test; } diff --git a/test/transform/resource/before/NonNullWithAlternateException.java b/test/transform/resource/before/NonNullWithAlternateException.java index 780afc39..c47f5727 100644 --- a/test/transform/resource/before/NonNullWithAlternateException.java +++ b/test/transform/resource/before/NonNullWithAlternateException.java @@ -1,4 +1,4 @@ -//CONF: lombok.nonNull.exceptionType = java.lang.IllegalArgumentException +//CONF: lombok.nonNull.exceptionType = IllegalArgumentException public class NonNullWithAlternateException { @lombok.NonNull @lombok.Setter private String test; diff --git a/test/transform/resource/before/NonNullWithMistypedException.java b/test/transform/resource/before/NonNullWithMistypedException.java deleted file mode 100644 index 6e1fb880..00000000 --- a/test/transform/resource/before/NonNullWithMistypedException.java +++ /dev/null @@ -1,7 +0,0 @@ -//CONF: lombok.nonNull.exceptionType = 12345 -//skip compare content: Just testing appropriate generation of error message. - -@lombok.Data -public class NonNullWithMistypedException { - private @lombok.NonNull String test; -} diff --git a/test/transform/resource/messages-delombok/NonNullWithMistypedException.java.messages b/test/transform/resource/messages-delombok/NonNullWithMistypedException.java.messages deleted file mode 100644 index 98bafe6e..00000000 --- a/test/transform/resource/messages-delombok/NonNullWithMistypedException.java.messages +++ /dev/null @@ -1 +0,0 @@ -4 Configuration key contains invalid java type reference '12345'; use something like 'java.lang.NullPointerException' as value for this key. diff --git a/test/transform/resource/messages-ecj/NonNullWithMistypedException.java.messages b/test/transform/resource/messages-ecj/NonNullWithMistypedException.java.messages deleted file mode 100644 index 98bafe6e..00000000 --- a/test/transform/resource/messages-ecj/NonNullWithMistypedException.java.messages +++ /dev/null @@ -1 +0,0 @@ -4 Configuration key contains invalid java type reference '12345'; use something like 'java.lang.NullPointerException' as value for this key. -- cgit