diff options
Diffstat (limited to 'src/core/lombok/javac/JavacNode.java')
-rw-r--r-- | src/core/lombok/javac/JavacNode.java | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/core/lombok/javac/JavacNode.java b/src/core/lombok/javac/JavacNode.java index 19bbeae3..3de3f38b 100644 --- a/src/core/lombok/javac/JavacNode.java +++ b/src/core/lombok/javac/JavacNode.java @@ -27,10 +27,6 @@ import java.util.List; import javax.lang.model.element.Element; import javax.tools.Diagnostic; -import lombok.core.AnnotationValues; -import lombok.core.AST.Kind; -import lombok.javac.handlers.JavacHandlerUtil; - import com.sun.tools.javac.code.Flags; import com.sun.tools.javac.code.Symtab; import com.sun.tools.javac.model.JavacTypes; @@ -43,8 +39,12 @@ import com.sun.tools.javac.tree.JCTree.JCMethodDecl; import com.sun.tools.javac.tree.JCTree.JCModifiers; import com.sun.tools.javac.tree.JCTree.JCVariableDecl; import com.sun.tools.javac.util.Context; -import com.sun.tools.javac.util.Name; import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; +import com.sun.tools.javac.util.Name; + +import lombok.core.AST.Kind; +import lombok.core.AnnotationValues; +import lombok.javac.handlers.JavacHandlerUtil; /** * Javac specific version of the LombokNode class. @@ -345,6 +345,29 @@ public class JavacNode extends lombok.core.LombokNode<JavacAST, JavacNode, JCTre return mods != null && (Flags.ENUM & mods.flags) != 0; } + @Override public boolean isPrimitive() { + if (node instanceof JCVariableDecl && !isEnumMember()) { + return Javac.isPrimitive(((JCVariableDecl) node).vartype); + } + if (node instanceof JCMethodDecl) { + return Javac.isPrimitive(((JCMethodDecl) node).restype); + } + return false; + } + + /** + * {@inheritDoc} + */ + @Override public String fieldOrMethodBaseType() { + if (node instanceof JCVariableDecl && !isEnumMember()) { + return (((JCVariableDecl) node).vartype).toString(); + } + if (node instanceof JCMethodDecl) { + return (((JCMethodDecl) node).restype).toString(); + } + return null; + } + @Override public boolean isTransient() { if (getKind() != Kind.FIELD) return false; JCModifiers mods = getModifiers(); |