Skip to content

Commit

Permalink
remove generic method handling
Browse files Browse the repository at this point in the history
  • Loading branch information
gayanper committed Dec 5, 2023
1 parent c9fa3be commit c4dfc7d
Showing 1 changed file with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,7 @@ private Location findMethodLocaiton(ReferenceType refType, String methodName, St
for (Method method : methods) {
if (!method.isAbstract() && !method.isNative()
&& methodName.equals(method.name())
&& (methodSiguature.equals(method.genericSignature()) || methodSiguature.equals(method.signature())
|| toNoneGeneric(methodSiguature).equals(method.signature()))) {
&& (methodSiguature.equals(method.genericSignature()) || methodSiguature.equals(method.signature()))) {
location = method.location();
break;
}
Expand All @@ -335,23 +334,6 @@ private Location findMethodLocaiton(ReferenceType refType, String methodName, St
return location;
}

private String toNoneGeneric(String genericSig) {
StringBuilder builder = new StringBuilder();
boolean skip = false;
for (char c : genericSig.toCharArray()) {
if (c == '<') {
skip = true;
}
if (!skip) {
builder.append(c);
}
if (skip && c == '>') {
skip = false;
}
}
return builder.toString();
}

private List<Location> findLocaitonsOfLine(Method method, int lineNumber) {
try {
return method.locationsOfLine(lineNumber);
Expand Down

0 comments on commit c4dfc7d

Please sign in to comment.