From e4b61e1263eb0eb832eb6cfbd97ad92e869ca27e Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 25 Mar 2019 23:12:13 +0100 Subject: [performance] fixing bug in earlier performance commit on optimizing lookups of typeMatches. --- src/core/lombok/javac/handlers/JavacHandlerUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java index 095d1c7a..9e6c8c00 100644 --- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java +++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java @@ -265,7 +265,7 @@ public class JavacHandlerUtil { */ public static boolean annotationTypeMatches(Class type, JavacNode node) { if (node.getKind() != Kind.ANNOTATION) return false; - return typeMatches(type, node, ((JCAnnotation)node.get()).annotationType); + return typeMatches(type, node, ((JCAnnotation) node.get()).annotationType); } /** @@ -301,7 +301,7 @@ public class JavacHandlerUtil { String typeName = typeNode == null ? null : typeNode.toString(); if (typeName == null || typeName.length() == 0) return false; int lastIndexA = typeName.lastIndexOf('.') + 1; - int lastIndexB = type.lastIndexOf('.') + 1; + int lastIndexB = Math.max(type.lastIndexOf('.'), type.lastIndexOf('$')) + 1; int len = typeName.length() - lastIndexA; if (len != type.length() - lastIndexB) return false; for (int i = 0; i < len; i++) if (typeName.charAt(i + lastIndexA) != type.charAt(i + lastIndexB)) return false; -- cgit