Make @Override annotations invisible

Normally they wouldn't be retained in the bytecode at all, but for obvious
reasons we can't do that! Making them invisible is at least closer to the
RetentionPolicy's intention than a visible annotation.
master
Graham 5 years ago
parent 5038d1d671
commit 41dac20719
  1. 8
      deob/src/main/java/dev/openrs2/deob/transform/OverrideTransformer.kt

@ -32,14 +32,14 @@ class OverrideTransformer : Transformer() {
return false
}
if (method.visibleAnnotations != null && method.visibleAnnotations.any { it.desc == OVERRIDE_DESC }) {
if (method.invisibleAnnotations != null && method.invisibleAnnotations.any { it.desc == OVERRIDE_DESC }) {
return false
}
if (method.visibleAnnotations == null) {
method.visibleAnnotations = mutableListOf()
if (method.invisibleAnnotations == null) {
method.invisibleAnnotations = mutableListOf()
}
method.visibleAnnotations.add(AnnotationNode(OVERRIDE_DESC))
method.invisibleAnnotations.add(AnnotationNode(OVERRIDE_DESC))
overrides++
return false

Loading…
Cancel
Save