Recaf icon indicating copy to clipboard operation
Recaf copied to clipboard

Allow MappingGenerator to keep the same name for method bridges

Open Col-E opened this issue 1 year ago • 0 comments

Rough idea given the following model:

abstract class Base<T extends Foo> {
  abstract void accept(T input);
}

class Impl extends Base<FooImpl> {
  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.

Col-E avatar Jun 03 '24 09:06 Col-E