Local variable names in inner class methods aren't fixed when they conflict with outer names
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza con el contexto de FernFlower-Patches/0037-Do-not-rebuild-variable-names-in-lambdas.patch y, después, inspecciona VarNamesCollector.setNewOuterNames y getFreeName(). Compara el comportamiento actual con el comportamiento de nomenclatura anterior descrito en el issue. Se considera terminado cuando los nombres locales en conflicto de los métodos internos se gestionan correctamente sin romper el comportamiento de los scopes anidados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
This is due to https://github.com/MinecraftForge/ForgeFlower/blob/master/FernFlower-Patches/0037-Do-not-rebuild-variable-names-in-lambdas.patch
For background on what that code is doing (re: the patch message):
That allows the decompiler to fix variable names in a nested class or lambda expression which clashes with the name of an outer variable.
What's happening is it's checking the names for the current method against the variable names defined in the outer scope. That's why setNewOuterNames is passed to VarNamesCollector, then checked for in VarNamesCollector.getFreeName() - the outer names are compared against the names for the nested method.
What FernFlower's code originally did was append x to local variable names when conflicts came up - but now it doesn't do that because of that patch. Considering that's the only thing that method is actually doing I don't know what the patch is actually trying to fix. The commit which added the patch said it fixes #88, but there is no issue 88 yet.
This comes up relatively infrequently, and I guess never in MCP due to how LVT is handled, but it causes an issue with my usage. This quick and dirty fix is because of this issue - previous versions of FernFlower would rename the inner i variable to ix. https://github.com/PaperMC/Paper/blob/mappings/mojang/Spigot-Server-Patches/0266-Optimize-BlockPosition-helper-methods.patch#L113-L134
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 110
- Forks
- 49
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MinecraftForge/ForgeFlower
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
MinecraftForge/ForgeFlower#131 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
MinecraftForge/ForgeFlower#85 · 3 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
MinecraftForge/ForgeFlower#76 · 1 comentario · 3 reacciones ·
Todos los issues de MinecraftForge/ForgeFlower
Issues similares
-
`String.Parser.chompUntilEndOr` leaves the column one short when it runs to the end past a newline Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
enhancement PyCDE
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
llvm:support
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
llvm/llvm-project#226296 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
abseil/abseil-cpp#2176 ·