aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-03-25 23:12:13 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-03-25 23:12:13 +0100
commite4b61e1263eb0eb832eb6cfbd97ad92e869ca27e (patch)
tree59d2dbd22dcedad5a2eaad2f64eabbcb9862eebb
parent228e99fe5203e92c7297325fec69a82abc1a4bd7 (diff)
downloadlombok-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.java4
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;