Col-E / Col-E/Recaf

Allow MappingGenerator to keep the same name for method bridges

Open
#800 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
7.4k
Forks
538
PR merge metrics
No merged PRs in 30d

Description

Rough idea given the following model:
```java
abstract class Base {
abstract void accept(T input);
}

class Impl extends Base {
void accept(FooImpl input); // becomes bridge to method with signature from parent xlass

// void accept(Foo input); // Method implementation goes here in actuality
}
```
Currently the mapping generator will see the two methods in `Impl` as having different signatures and will thus allow the passed `NameGenerator` to create unique names for each. For keeping things pretty in the decompiler output, it would be nice if we could have these bridge methods share the same name as the real method taking on the parent method's signature.

I think having a generic system to track _"this method is a bridge to this method"_ would be nice, which once completed could be plugged into the `MappingGenerator` code with ease.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.