aboutsummaryrefslogtreecommitdiff
path: root/src/utils/lombok/javac
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/lombok/javac')
-rw-r--r--src/utils/lombok/javac/Javac.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/utils/lombok/javac/Javac.java b/src/utils/lombok/javac/Javac.java
index 9ff4d22f..92961726 100644
--- a/src/utils/lombok/javac/Javac.java
+++ b/src/utils/lombok/javac/Javac.java
@@ -36,6 +36,8 @@ import javax.lang.model.type.NoType;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeVisitor;
+import lombok.core.ClassLiteral;
+import lombok.core.FieldSelect;
import lombok.javac.JavacTreeMaker.TreeTag;
import lombok.javac.JavacTreeMaker.TypeTag;
@@ -143,16 +145,17 @@ public class Javac {
return ((Number) lit.value).intValue() == 0 ? false : true;
}
return lit.value;
- } else if (expr instanceof JCIdent || expr instanceof JCFieldAccess) {
+ }
+
+ if (expr instanceof JCIdent || expr instanceof JCFieldAccess) {
String x = expr.toString();
- if (x.endsWith(".class")) x = x.substring(0, x.length() - 6);
- else {
- int idx = x.lastIndexOf('.');
- if (idx > -1) x = x.substring(idx + 1);
- }
- return x;
- } else
- return null;
+ if (x.endsWith(".class")) return new ClassLiteral(x.substring(0, x.length() - 6));
+ int idx = x.lastIndexOf('.');
+ if (idx > -1) x = x.substring(idx + 1);
+ return new FieldSelect(x);
+ }
+
+ return null;
}
public static final TypeTag CTC_BOOLEAN = typeTag("BOOLEAN");