diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-11-12 22:07:07 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-11-12 22:07:07 +0100 |
commit | 7e84f8d1c2abd902dfc7a88c2f60c58717a955a1 (patch) | |
tree | ca384cb2aac5d08982ea57612e145f4642882f5d /src/core/lombok/javac/handlers/HandleGetter.java | |
parent | 8a6167f8b03b0b60e9fece01ff73c45a49b8ff9d (diff) | |
download | lombok-7e84f8d1c2abd902dfc7a88c2f60c58717a955a1.tar.gz lombok-7e84f8d1c2abd902dfc7a88c2f60c58717a955a1.tar.bz2 lombok-7e84f8d1c2abd902dfc7a88c2f60c58717a955a1.zip |
[refactor] Cleaned up static imports (always use *), and refactored out getCtcInt calls into constants as defined in Javac.
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleGetter.java')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleGetter.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/core/lombok/javac/handlers/HandleGetter.java b/src/core/lombok/javac/handlers/HandleGetter.java index 8a1fb4e1..65947c72 100644 --- a/src/core/lombok/javac/handlers/HandleGetter.java +++ b/src/core/lombok/javac/handlers/HandleGetter.java @@ -42,7 +42,6 @@ import lombok.javac.handlers.JavacHandlerUtil.FieldAccess; import org.mangosdk.spi.ProviderFor; import com.sun.tools.javac.code.Flags; -import com.sun.tools.javac.code.TypeTags; import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.tree.TreeMaker; import com.sun.tools.javac.tree.JCTree.JCAnnotation; @@ -288,14 +287,14 @@ public class HandleGetter extends JavacAnnotationHandler<Getter> { private static final java.util.Map<Integer, String> TYPE_MAP; static { Map<Integer, String> m = new HashMap<Integer, String>(); - m.put(getCtcInt(TypeTags.class, "INT"), "java.lang.Integer"); - m.put(getCtcInt(TypeTags.class, "DOUBLE"), "java.lang.Double"); - m.put(getCtcInt(TypeTags.class, "FLOAT"), "java.lang.Float"); - m.put(getCtcInt(TypeTags.class, "SHORT"), "java.lang.Short"); - m.put(getCtcInt(TypeTags.class, "BYTE"), "java.lang.Byte"); - m.put(getCtcInt(TypeTags.class, "LONG"), "java.lang.Long"); - m.put(getCtcInt(TypeTags.class, "BOOLEAN"), "java.lang.Boolean"); - m.put(getCtcInt(TypeTags.class, "CHAR"), "java.lang.Character"); + m.put(CTC_INT, "java.lang.Integer"); + m.put(CTC_DOUBLE, "java.lang.Double"); + m.put(CTC_FLOAT, "java.lang.Float"); + m.put(CTC_SHORT, "java.lang.Short"); + m.put(CTC_BYTE, "java.lang.Byte"); + m.put(CTC_LONG, "java.lang.Long"); + m.put(CTC_BOOLEAN, "java.lang.Boolean"); + m.put(CTC_CHAR, "java.lang.Character"); TYPE_MAP = Collections.unmodifiableMap(m); } @@ -361,7 +360,7 @@ public class HandleGetter extends JavacAnnotationHandler<Getter> { innerIfStatements.append(statement); } - JCBinary isNull = maker.Binary(getCtcInt(JCTree.class, "EQ"), maker.Ident(valueName), maker.Literal(getCtcInt(TypeTags.class, "BOT"), null)); + JCBinary isNull = maker.Binary(CTC_EQUAL, maker.Ident(valueName), maker.Literal(CTC_BOT, null)); JCIf ifStatement = maker.If(isNull, maker.Block(0, innerIfStatements.toList()), null); synchronizedStatements.append(ifStatement); } @@ -369,7 +368,7 @@ public class HandleGetter extends JavacAnnotationHandler<Getter> { synchronizedStatement = maker.Synchronized(createFieldAccessor(maker, fieldNode, FieldAccess.ALWAYS_FIELD), maker.Block(0, synchronizedStatements.toList())); } - JCBinary isNull = maker.Binary(getCtcInt(JCTree.class, "EQ"), maker.Ident(valueName), maker.Literal(getCtcInt(TypeTags.class, "BOT"), null)); + JCBinary isNull = maker.Binary(CTC_EQUAL, maker.Ident(valueName), maker.Literal(CTC_BOT, null)); JCIf ifStatement = maker.If(isNull, maker.Block(0, List.<JCStatement>of(synchronizedStatement)), null); statements.append(ifStatement); } |