Skip to content

Change the retofitter to be able to rewrite Java 11 bytecode

Remi Forax requested to merge retrofit-java-11 into master

It's time to stop using Java 8 as the source version and at least move to Java 11.

I've modified the retrofitter

  • so all string concatenations that use invokedynamic since Java 9 are rewritten to use a StringBuilder (each string builder is isolated to its own static method which is easier to write AND should perform better because most of our allocation are inside the call to a constructor of an exception).
  • to add a new verifier pass that check that we can safely remove the nestmate attributes (NestHost, NestMembers) Since Java 11, the compiler can directly reference a private member from a nested class without adding an access$ method using the nestmate attributes instead. Given we want to remove those attributes, the new verifier pass check that this is safe but not allowing a class to reference a private member from another class.
Edited by Remi Forax

Merge request reports