Signed-off-by: Graham <gpe@openrs2.dev>
@ -31,7 +31,7 @@ fun ClassNode.remap(remapper: Remapper) {
method.signature = remapper.mapSignature(method.signature, false)
method.exceptions = method.exceptions.map(remapper::mapType)
if (method.hasCode()) {
if (method.hasCode) {
ClassForNameUtils.remap(remapper, method)
for (insn in method.instructions) {
@ -123,9 +123,8 @@ fun MethodNode.removeDeadCode(owner: String) {
} while (changed)
}
fun MethodNode.hasCode(): Boolean {
return access and (Opcodes.ACC_NATIVE or Opcodes.ACC_ABSTRACT) == 0
val MethodNode.hasCode
get() = access and (Opcodes.ACC_NATIVE or Opcodes.ACC_ABSTRACT) == 0
fun MethodNode.copy(): MethodNode {
val copy = MethodNode(
@ -26,7 +26,7 @@ abstract class Transformer {
for (method in clazz.methods) {
changed = changed or preTransformMethod(classPath, library, clazz, method)
changed = changed or transformCode(classPath, library, clazz, method)
@ -26,7 +26,7 @@ class BufferSizeTransformer : Transformer() {
for (library in classPath.libraries) {
for (clazz in library) {
if (!method.hasCode()) {
if (!method.hasCode) {
continue
@ -27,7 +27,7 @@ class BitwiseOpTransformer : Transformer() {
@ -99,7 +99,7 @@ class ConstantArgTransformer : Transformer() {
// find ClassNode/MethodNode
val owner = classPath.getClassNode(ref.owner) ?: return
val originalMethod = owner.methods.singleOrNull { it.name == ref.name && it.desc == ref.desc } ?: return
if (!originalMethod.hasCode()) {
if (!originalMethod.hasCode) {
return
@ -26,7 +26,7 @@ class CounterTransformer : Transformer() {
findCounters(method, references, resets, increments)
@ -30,7 +30,7 @@ class OpaquePredicateTransformer : Transformer() {
findFlowObstructors(library, method)
@ -28,7 +28,7 @@ class ResetTransformer : Transformer() {
@ -36,7 +36,7 @@ class UnusedArgTransformer : Transformer() {
populateRetainedArgs(classPath, clazz, method)
@ -94,7 +94,7 @@ class UnusedArgTransformer : Transformer() {
method: MethodNode
): Boolean {
// delete unused int args from call sites
return false