mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 16:29:39 +00:00
Fix java method declaration MethodInfo not being fetched properly
This commit is contained in:
1 parent
dd2e7f765c
commit
0c842a22b9
1 file changed
+7
-2
@@ -3842,7 +3842,7 @@ public class ScriptDocument {
|
||||
continue;
|
||||
|
||||
// Skip class/interface/enum declarations - these look like method declarations
|
||||
// but "class Foo(" is not a method, it's a class declaration
|
||||
// but "class Foo(" is not a method, it's a class declaration3
|
||||
String returnType = m.group(1);
|
||||
if (returnType.equals("class") || returnType.equals("interface") || returnType.equals("enum") ||returnType.equals("new")) {
|
||||
continue;
|
||||
@@ -3850,9 +3850,14 @@ public class ScriptDocument {
|
||||
|
||||
// Find the corresponding MethodInfo created in parseMethodDeclarations
|
||||
int methodDeclStart = m.start();
|
||||
int methodNameStart = m.start(2);
|
||||
MethodInfo methodInfo = null;
|
||||
for (MethodInfo method : getAllMethods()) {
|
||||
if (method.getFullDeclarationOffset() == methodDeclStart) {
|
||||
boolean matchesDeclStart = method.getTypeOffset() == methodDeclStart
|
||||
|| method.getFullDeclarationOffset() == methodDeclStart;
|
||||
boolean matchesNameStart = method.getNameOffset() == methodNameStart;
|
||||
|
||||
if (matchesDeclStart || matchesNameStart) {
|
||||
methodInfo = method;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user