diff options
| author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-02-04 00:08:48 +0100 |
|---|---|---|
| committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-02-04 00:08:48 +0100 |
| commit | 58a7914027e3373faa942aa4ce7df2d3ebfb9a20 (patch) | |
| tree | cb0627b028f9753a7b4c94ec2373c07a4f3fd9f8 /test/transform/resource/after-ecj | |
| parent | 74b38cd7d6806723145f6183273468996ea7dd57 (diff) | |
| download | lombok-58a7914027e3373faa942aa4ce7df2d3ebfb9a20.tar.gz lombok-58a7914027e3373faa942aa4ce7df2d3ebfb9a20.tar.bz2 lombok-58a7914027e3373faa942aa4ce7df2d3ebfb9a20.zip | |
@UtilityClass handlers now more intelligent about inner types of implicitly static contexts (enums, interfaces, and annotation declarations). Also added tests to test for these.
Diffstat (limited to 'test/transform/resource/after-ecj')
| -rw-r--r-- | test/transform/resource/after-ecj/UtilityClass.java | 25 | ||||
| -rw-r--r-- | test/transform/resource/after-ecj/UtilityClassErrors.java | 16 |
2 files changed, 41 insertions, 0 deletions
diff --git a/test/transform/resource/after-ecj/UtilityClass.java b/test/transform/resource/after-ecj/UtilityClass.java index c3e06fbc..e8db6a21 100644 --- a/test/transform/resource/after-ecj/UtilityClass.java +++ b/test/transform/resource/after-ecj/UtilityClass.java @@ -27,6 +27,31 @@ class UtilityInner { super(); } } + enum UtilityInsideEnum { + static final @lombok.experimental.UtilityClass class InsideEnum { + static int member; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") InsideEnum() { + super(); + throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); + } + } + FOO(), + BAR(), + <clinit>() { + } + UtilityInsideEnum() { + super(); + } + } + interface UtilityInsideInterface { + final @lombok.experimental.UtilityClass class InsideInterface { + static int member; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") InsideInterface() { + super(); + throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); + } + } + } UtilityInner() { super(); } diff --git a/test/transform/resource/after-ecj/UtilityClassErrors.java b/test/transform/resource/after-ecj/UtilityClassErrors.java index 03206592..26b331a1 100644 --- a/test/transform/resource/after-ecj/UtilityClassErrors.java +++ b/test/transform/resource/after-ecj/UtilityClassErrors.java @@ -18,3 +18,19 @@ final @lombok.experimental.UtilityClass class UtilityClassErrors1 { super(); } } +class UtilityClassErrors3 { + class NonStaticInner { + @lombok.experimental.UtilityClass class ThisShouldFail { + private String member; + ThisShouldFail() { + super(); + } + } + NonStaticInner() { + super(); + } + } + UtilityClassErrors3() { + super(); + } +} |
