aboutsummaryrefslogtreecommitdiff
path: root/src/utils/lombok/javac
diff options
context:
space:
mode:
authorRobbert Jan Grootjans <grootjans@gmail.com>2013-04-05 14:37:11 +0200
committerRobbert Jan Grootjans <grootjans@gmail.com>2013-04-05 14:37:11 +0200
commit172202add2d0cb63e5b0780e7e3fc6000e43a3d9 (patch)
tree7c1cfdfa473207980f7c863734beb370bd088feb /src/utils/lombok/javac
parent2658b1ba42001e62e8ffd57702ba915602c04224 (diff)
downloadlombok-172202add2d0cb63e5b0780e7e3fc6000e43a3d9.tar.gz
lombok-172202add2d0cb63e5b0780e7e3fc6000e43a3d9.tar.bz2
lombok-172202add2d0cb63e5b0780e7e3fc6000e43a3d9.zip
Some small fixes for Java 7
Diffstat (limited to 'src/utils/lombok/javac')
-rw-r--r--src/utils/lombok/javac/Javac.java22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/utils/lombok/javac/Javac.java b/src/utils/lombok/javac/Javac.java
index cbbd6730..b766630f 100644
--- a/src/utils/lombok/javac/Javac.java
+++ b/src/utils/lombok/javac/Javac.java
@@ -22,6 +22,7 @@
package lombok.javac;
import java.lang.reflect.Method;
+import java.util.Objects;
import java.util.regex.Pattern;
import com.sun.tools.javac.main.JavaCompiler;
@@ -31,6 +32,7 @@ import com.sun.tools.javac.tree.JCTree.JCExpression;
import com.sun.tools.javac.tree.JCTree.JCFieldAccess;
import com.sun.tools.javac.tree.JCTree.JCIdent;
import com.sun.tools.javac.tree.JCTree.JCLiteral;
+import com.sun.tools.javac.tree.JCTree.JCPrimitiveTypeTree;
import com.sun.tools.javac.tree.JCTree.JCUnary;
import com.sun.tools.javac.tree.TreeMaker;
@@ -137,7 +139,7 @@ public class Javac {
public static boolean compareCTC(Object ctc1, Object ctc2) {
- return ctc1.equals(ctc2);
+ return Objects.equals(ctc1, ctc2);
}
/**
@@ -187,20 +189,14 @@ public class Javac {
}
}
-
- public static Object getTreeTypeTag(JCTree tree) {
- try {
- return TreeMaker.class.getField("typetag").get(tree);
- } catch (NoSuchFieldException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (Exception e) {
- if (e instanceof RuntimeException) throw (RuntimeException) e;
- throw new RuntimeException(e);
- }
+ public static Object getTreeTypeTag(JCPrimitiveTypeTree tree) {
+ return tree.typetag;
}
+ public static Object getTreeTypeTag(JCLiteral tree) {
+ return tree.typetag;
+ }
+
public static JCExpression makeTypeIdent(TreeMaker maker, Object ctc) {
try {
Method createIdent;