diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-02-02 04:47:21 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-02-02 04:52:20 +0100 |
commit | d8da2b9438056e945ecc38d98fed413444c847b3 (patch) | |
tree | 6d421923faaaf8566a7f827f3a803513c96c602b /test/transform | |
parent | 46ce592dff458a0561fed900c0659bccb1755a1a (diff) | |
download | lombok-d8da2b9438056e945ecc38d98fed413444c847b3.tar.gz lombok-d8da2b9438056e945ecc38d98fed413444c847b3.tar.bz2 lombok-d8da2b9438056e945ecc38d98fed413444c847b3.zip |
added impl for @UtilityClass.
Diffstat (limited to 'test/transform')
8 files changed, 131 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/UtilityClass.java b/test/transform/resource/after-delombok/UtilityClass.java new file mode 100644 index 00000000..f9fe02a0 --- /dev/null +++ b/test/transform/resource/after-delombok/UtilityClass.java @@ -0,0 +1,26 @@ +final class UtilityClass { + private static String someField; + static void someMethod() { + System.out.println(); + } + protected static class InnerClass { + private String innerInnerMember; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private UtilityClass() { + throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); + } +} +class UtilityInner { + static class InnerInner { + static final class InnerInnerInner { + static int member; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private InnerInnerInner() { + throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); + } + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/UtilityClassErrors.java b/test/transform/resource/after-delombok/UtilityClassErrors.java new file mode 100644 index 00000000..b19b4e72 --- /dev/null +++ b/test/transform/resource/after-delombok/UtilityClassErrors.java @@ -0,0 +1,12 @@ +final class UtilityClassErrors1 { + private static String someField; + protected UtilityClassErrors1() { + } + static void method() { + class MethodLocalClass { + } + } +} +enum UtilityClassErrors2 { +; +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/UtilityClass.java b/test/transform/resource/after-ecj/UtilityClass.java new file mode 100644 index 00000000..c3e06fbc --- /dev/null +++ b/test/transform/resource/after-ecj/UtilityClass.java @@ -0,0 +1,33 @@ +final @lombok.experimental.UtilityClass class UtilityClass { + protected static class InnerClass { + private String innerInnerMember; + protected InnerClass() { + super(); + } + } + private static String someField; + static void someMethod() { + System.out.println(); + } + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") UtilityClass() { + super(); + throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); + } +} +class UtilityInner { + static class InnerInner { + static final @lombok.experimental.UtilityClass class InnerInnerInner { + static int member; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") InnerInnerInner() { + super(); + throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); + } + } + InnerInner() { + super(); + } + } + UtilityInner() { + super(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/UtilityClassErrors.java b/test/transform/resource/after-ecj/UtilityClassErrors.java new file mode 100644 index 00000000..03206592 --- /dev/null +++ b/test/transform/resource/after-ecj/UtilityClassErrors.java @@ -0,0 +1,20 @@ +final @lombok.experimental.UtilityClass class UtilityClassErrors1 { + private static String someField; + protected UtilityClassErrors1() { + super(); + } + static void method() { + @lombok.experimental.UtilityClass class MethodLocalClass { + MethodLocalClass() { + super(); + } + } + } +} +@lombok.experimental.UtilityClass enum UtilityClassErrors2 { + <clinit>() { + } + UtilityClassErrors2() { + super(); + } +} diff --git a/test/transform/resource/before/UtilityClass.java b/test/transform/resource/before/UtilityClass.java new file mode 100644 index 00000000..ccfa43e1 --- /dev/null +++ b/test/transform/resource/before/UtilityClass.java @@ -0,0 +1,20 @@ +@lombok.experimental.UtilityClass +class UtilityClass { + private String someField; + + void someMethod() { + System.out.println(); + } + + protected class InnerClass { + private String innerInnerMember; + } +} +class UtilityInner { + static class InnerInner { + @lombok.experimental.UtilityClass + class InnerInnerInner { + int member; + } + } +} diff --git a/test/transform/resource/before/UtilityClassErrors.java b/test/transform/resource/before/UtilityClassErrors.java new file mode 100644 index 00000000..5f72274b --- /dev/null +++ b/test/transform/resource/before/UtilityClassErrors.java @@ -0,0 +1,14 @@ +@lombok.experimental.UtilityClass +class UtilityClassErrors1 { + private String someField; + protected UtilityClassErrors1() { + } + void method() { + @lombok.experimental.UtilityClass + class MethodLocalClass { + } + } +} +@lombok.experimental.UtilityClass +enum UtilityClassErrors2 { +}
\ No newline at end of file diff --git a/test/transform/resource/messages-delombok/UtilityClassErrors.java.messages b/test/transform/resource/messages-delombok/UtilityClassErrors.java.messages new file mode 100644 index 00000000..230ba04f --- /dev/null +++ b/test/transform/resource/messages-delombok/UtilityClassErrors.java.messages @@ -0,0 +1,3 @@ +4 @UtilityClasses cannot have declared constructors. +7 @UtilityClass cannot be placed on a method local or anonymous inner class, or any class nested in such a class. +12 @UtilityClass is only supported on a class (can't be an interface, enum, or annotation). diff --git a/test/transform/resource/messages-ecj/UtilityClassErrors.java.messages b/test/transform/resource/messages-ecj/UtilityClassErrors.java.messages new file mode 100644 index 00000000..c80a18dc --- /dev/null +++ b/test/transform/resource/messages-ecj/UtilityClassErrors.java.messages @@ -0,0 +1,3 @@ +4 @UtilityClasses cannot have declared constructors. +7 @UtilityClass cannot be placed on a method local or anonymous inner class, or any class nested in such a class. +12 @UtilityClass is only supported on a class (can't be an interface, enum, or annotation)
\ No newline at end of file |