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-delombok | |
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-delombok')
-rw-r--r-- | test/transform/resource/after-delombok/UtilityClass.java | 22 | ||||
-rw-r--r-- | test/transform/resource/after-delombok/UtilityClassErrors.java | 7 |
2 files changed, 29 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/UtilityClass.java b/test/transform/resource/after-delombok/UtilityClass.java index f9fe02a0..eb7eef09 100644 --- a/test/transform/resource/after-delombok/UtilityClass.java +++ b/test/transform/resource/after-delombok/UtilityClass.java @@ -23,4 +23,26 @@ class UtilityInner { } } } + enum UtilityInsideEnum { + FOO, + BAR; + static final class InsideEnum { + static int member; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private InsideEnum() { + throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); + } + } + } + interface UtilityInsideInterface { + final class InsideInterface { + static int member; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private InsideInterface() { + 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 index b19b4e72..9626461a 100644 --- a/test/transform/resource/after-delombok/UtilityClassErrors.java +++ b/test/transform/resource/after-delombok/UtilityClassErrors.java @@ -9,4 +9,11 @@ final class UtilityClassErrors1 { } enum UtilityClassErrors2 { ; +} +class UtilityClassErrors3 { + class NonStaticInner { + class ThisShouldFail { + private String member; + } + } }
\ No newline at end of file |