aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2020-06-19 00:47:00 +0200
committerRoel Spilker <r.spilker@gmail.com>2020-06-19 00:48:56 +0200
commited8ea0d8043cb8df6ae3fb962ab3a2087f4adeb6 (patch)
tree64f716ceb6de12c77a9d48494feac48f8759934f /src/core/lombok/eclipse
parent39d2c280fbaced63f5697481af6b37ab81891798 (diff)
downloadlombok-ed8ea0d8043cb8df6ae3fb962ab3a2087f4adeb6.tar.gz
lombok-ed8ea0d8043cb8df6ae3fb962ab3a2087f4adeb6.tar.bz2
lombok-ed8ea0d8043cb8df6ae3fb962ab3a2087f4adeb6.zip
#1543: First primitives, then primitive wrappers, then other references
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r--src/core/lombok/eclipse/EclipseNode.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/core/lombok/eclipse/EclipseNode.java b/src/core/lombok/eclipse/EclipseNode.java
index 5aa29466..12e9ccdb 100644
--- a/src/core/lombok/eclipse/EclipseNode.java
+++ b/src/core/lombok/eclipse/EclipseNode.java
@@ -275,6 +275,29 @@ public class EclipseNode extends lombok.core.LombokNode<EclipseAST, EclipseNode,
return false;
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override public String fieldOrMethodBaseType() {
+ TypeReference typeReference = null;
+ if (node instanceof FieldDeclaration && !isEnumMember()) {
+ typeReference = ((FieldDeclaration) node).type;
+ }
+ if (node instanceof MethodDeclaration) {
+ typeReference = ((MethodDeclaration) node).returnType;
+ }
+ if (typeReference == null) return null;
+
+ String fqn = Eclipse.toQualifiedName(typeReference.getTypeName());
+ if (typeReference.dimensions() == 0) return fqn;
+ StringBuilder result = new StringBuilder(fqn.length() + 2 * typeReference.dimensions());
+ result.append(fqn);
+ for (int i = 0; i < typeReference.dimensions(); i++) {
+ result.append("[]");
+ }
+ return result.toString();
+ }
+
@Override public boolean isTransient() {
if (getKind() != Kind.FIELD) return false;
Integer i = getModifiers();