MinecraftForge / Srg2Source

Applies source level refactors to java source code.
GNU Lesser General Public License v2.1
60 stars 32 forks source link

Fix compact constructor extraction and improve record component range calculation #53

Closed coehlrich closed 2 years ago

coehlrich commented 2 years ago

This treats the parameter references in compact constructors as fields since the only place in the eclipse dom they are defined are in the record declaration where they generate a different key

Changes the record component range calculation so that they don't use for loops and the range contains int component instead of >(int component if the record has at least 1 type parameter, (int component if the record doesn't have any type parameters, or with the original bug the entire length of the record twice plusthe length of the class before the record (and with atleast 1 type parameter with an offset of everything before the last type parameter is declared) while also making it not generate an empty method if a record contains no record components (which javac does allow)