diff options
author | Rawi01 <Rawi01@users.noreply.github.com> | 2020-06-19 17:25:41 +0200 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2020-06-25 21:36:19 +0200 |
commit | 4e359da7cc079c8283f758f464b65f1bcaa78a7b (patch) | |
tree | 45e22b41cc1f4008b9b9feb8e6fc46260b53bfd8 /src/core/lombok/eclipse | |
parent | e964c995caa948e3b9ac3fc531a09e200124ec73 (diff) | |
download | lombok-4e359da7cc079c8283f758f464b65f1bcaa78a7b.tar.gz lombok-4e359da7cc079c8283f758f464b65f1bcaa78a7b.tar.bz2 lombok-4e359da7cc079c8283f758f464b65f1bcaa78a7b.zip |
Replace getSimpleName() with getName()
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r-- | src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index 6b9571c7..1b4f510c 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -233,14 +233,7 @@ public class EclipseHandlerUtil { * @param typeRef A type reference to check. */ public static boolean typeMatches(Class<?> type, EclipseNode node, TypeReference typeRef) { - if (typeRef == null || typeRef.getTypeName() == null || typeRef.getTypeName().length == 0) return false; - String lastPartA = new String(typeRef.getTypeName()[typeRef.getTypeName().length -1]); - String lastPartB = type.getSimpleName(); - if (!lastPartA.equals(lastPartB)) return false; - String typeName = toQualifiedName(typeRef.getTypeName()); - - TypeResolver resolver = new TypeResolver(node.getImportList()); - return resolver.typeMatches(node, type.getName(), typeName); + return typeMatches(type.getName(), node, typeRef); } /** @@ -254,7 +247,7 @@ public class EclipseHandlerUtil { char[][] tn = typeRef == null ? null : typeRef.getTypeName(); if (tn == null || tn.length == 0) return false; char[] lastPartA = tn[tn.length - 1]; - int lastIndex = type.lastIndexOf('.') + 1; + int lastIndex = Math.max(type.lastIndexOf('.'), type.lastIndexOf('$')) + 1; if (lastPartA.length != type.length() - lastIndex) return false; for (int i = 0; i < lastPartA.length; i++) if (lastPartA[i] != type.charAt(i + lastIndex)) return false; String typeName = toQualifiedName(tn); |