diff options
author | peichhorn <peichhor@web.de> | 2011-11-13 09:02:55 +0100 |
---|---|---|
committer | peichhorn <peichhor@web.de> | 2011-11-13 09:06:57 +0100 |
commit | 0d75d56fcef943d1a35f1169386830066371c12d (patch) | |
tree | e274449da3344e8ba1e09da5878b5e4a2a51d5db /test/transform/resource/after-eclipse/InjectField.java | |
parent | fb4d2a45d21ed33405f8c2eddb05da6040ee3159 (diff) | |
download | lombok-0d75d56fcef943d1a35f1169386830066371c12d.tar.gz lombok-0d75d56fcef943d1a35f1169386830066371c12d.tar.bz2 lombok-0d75d56fcef943d1a35f1169386830066371c12d.zip |
Eclipse/JavacHandlerUtil.injectField(...) inserts the new fields after the enum constants.
Also the new fields are ordered in the same way the method injectField() gets invoked.
Diffstat (limited to 'test/transform/resource/after-eclipse/InjectField.java')
-rw-r--r-- | test/transform/resource/after-eclipse/InjectField.java | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/test/transform/resource/after-eclipse/InjectField.java b/test/transform/resource/after-eclipse/InjectField.java new file mode 100644 index 00000000..83d9e5fa --- /dev/null +++ b/test/transform/resource/after-eclipse/InjectField.java @@ -0,0 +1,63 @@ +import java.util.logging.Level; +import lombok.extern.java.Log; +import lombok.Synchronized; +@Log enum InjectField1 { + A(), + B(), + private final java.lang.Object $lock = new java.lang.Object[0]; + private static final java.lang.Object $LOCK = new java.lang.Object[0]; + private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(InjectField1.class.getName()); + private static final String LOG_MESSAGE = "static initializer"; + private String fieldA; + static { + log.log(Level.FINE, LOG_MESSAGE); + } + private String fieldB; + <clinit>() { + } + InjectField1() { + super(); + } + @Synchronized void generateLockField() { + synchronized (this.$lock) + { + System.out.println("lock field"); + } + } + static @Synchronized void generateStaticLockField() { + synchronized (InjectField1.$LOCK) + { + System.out.println("static lock field"); + } + } +} +@Log class InjectField2 { + private final java.lang.Object $lock = new java.lang.Object[0]; + private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(InjectField2.class.getName()); + private static final String LOG_MESSAGE = "static initializer"; + static { + log.log(Level.FINE, LOG_MESSAGE); + } + <clinit>() { + } + InjectField2() { + super(); + } + @Synchronized void generateLockField() { + synchronized (this.$lock) + { + System.out.println("lock field"); + } + } +} +@Log class InjectField3 { + private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(InjectField3.class.getName()); + static { + log.log(Level.FINE, "static initializer"); + } + <clinit>() { + } + InjectField3() { + super(); + } +} |