Skip to content

Commit

Permalink
project(injector): Remove edge case checks and let the injector handl…
Browse files Browse the repository at this point in the history
…e it
  • Loading branch information
Owain94 committed May 11, 2022
1 parent dfddf15 commit 8ed22ca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -457,17 +457,22 @@ else if (hasInject)
}
}*/

Method copy = new Method(targetClass, mixinMethod.getName(), mixinMethod.getDescriptor());
moveCode(copy, mixinMethod.getCode());
copy.setAccessFlags(mixinMethod.getAccessFlags());
copy.setPublic();
assert mixinMethod.getExceptions().getExceptions().isEmpty();
Method method = targetClass.findMethod(mixinMethod.getName(), mixinMethod.getDescriptor());

setOwnersToTargetClass(mixinClass, targetClass, copy, copiedMethods);
if (method == null)
{
method = new Method(targetClass, mixinMethod.getName(), mixinMethod.getDescriptor());
targetClass.addMethod(method);
}

targetClass.addMethod(copy);
moveCode(method, mixinMethod.getCode());
method.setAccessFlags(mixinMethod.getAccessFlags());
method.setPublic();
assert mixinMethod.getExceptions().getExceptions().isEmpty();

log.debug("[DEBUG] Injected mixin method {} to {}", copy, targetClass);
setOwnersToTargetClass(mixinClass, targetClass, method, copiedMethods);

log.debug("[DEBUG] Injected mixin method {} to {}", method, targetClass);
++injected;
}
else if (mixinMethod.findAnnotation(REPLACE) != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ public void inject()

for (Method method : runeLiteDeob.getMethods())
{
if (className.equals("RuneLiteMenuEntry") && (method.getName().equals("getItemId") || method.getName().equals("getWidget") || method.getName().equals("getItemOp")))
{
continue;
}

transformMethod(method);
runeliteObjectVanilla.addMethod(method);
}
Expand Down

0 comments on commit 8ed22ca

Please sign in to comment.