diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-03-25 23:12:13 +0100 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-03-25 23:12:13 +0100 |
commit | e4b61e1263eb0eb832eb6cfbd97ad92e869ca27e (patch) | |
tree | 59d2dbd22dcedad5a2eaad2f64eabbcb9862eebb | |
parent | 228e99fe5203e92c7297325fec69a82abc1a4bd7 (diff) | |
download | lombok-e4b61e1263eb0eb832eb6cfbd97ad92e869ca27e.tar.gz lombok-e4b61e1263eb0eb832eb6cfbd97ad92e869ca27e.tar.bz2 lombok-e4b61e1263eb0eb832eb6cfbd97ad92e869ca27e.zip |
[performance] fixing bug in earlier performance commit on optimizing lookups of typeMatches.
-rw-r--r-- | src/core/lombok/javac/handlers/JavacHandlerUtil.java | 4 |
1 files 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<? extends Annotation> 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; |