mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 20:07:32 +00:00
Detected duplicate methods for ScriptTypeInfo methods
This commit is contained in:
1 parent
002d2a6f15
commit
20f1c7cb66
2 files changed
+15
No files matched your search
@@ -636,6 +636,13 @@ public class ScriptDocument {
|
||||
int scopeDepth = calculateScopeDepth(method.getFullDeclarationOffset());
|
||||
methodsByScope.computeIfAbsent(scopeDepth, k -> new ArrayList<>()).add(method);
|
||||
}
|
||||
|
||||
for (ScriptTypeInfo type : scriptTypes.values()) {
|
||||
for (MethodInfo method : type.getAllMethodsFlat()) {
|
||||
int scopeDepth = calculateScopeDepth(method.getFullDeclarationOffset());
|
||||
methodsByScope.computeIfAbsent(scopeDepth, k -> new ArrayList<>()).add(method);
|
||||
}
|
||||
}
|
||||
|
||||
// Check each scope for duplicates
|
||||
for (List<MethodInfo> scopeMethods : methodsByScope.values()) {
|
||||
|
||||
@@ -148,6 +148,14 @@ public class ScriptTypeInfo extends TypeInfo {
|
||||
return new HashMap<>(methods);
|
||||
}
|
||||
|
||||
public List<MethodInfo> getAllMethodsFlat() {
|
||||
List<MethodInfo> allMethods = new ArrayList<>();
|
||||
for (List<MethodInfo> overloads : methods.values()) {
|
||||
allMethods.addAll(overloads);
|
||||
}
|
||||
return allMethods;
|
||||
}
|
||||
|
||||
// ==================== CONSTRUCTOR MANAGEMENT ====================
|
||||
|
||||
public void addConstructor(MethodInfo constructor) {
|
||||
|
||||
Reference in new issue
Block a user