Local variable names in inner class methods aren't fixed when they conflict with outer names
まだ誰も着手していません。
評価
調査の方向性
まず FernFlower-Patches/0037-Do-not-rebuild-variable-names-in-lambdas.patch のコンテキストを確認し、次に VarNamesCollector.setNewOuterNames と getFreeName() を調べます。現在の動作を、issue で説明されている以前の命名動作と比較します。内部メソッド内で競合するローカル名が正しく処理され、ネストされたスコープの動作を壊さなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- 言語のデータがありません
- スター
- 110
- フォーク
- 49
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MinecraftForge/ForgeFlower のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
MinecraftForge/ForgeFlower#131 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
MinecraftForge/ForgeFlower#85 · コメント 3 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
MinecraftForge/ForgeFlower#76 · コメント 1 件 · リアクション 3 件 ·
MinecraftForge/ForgeFlower の issue をすべて見る
似ている issue
-
`String.Parser.chompUntilEndOr` leaves the column one short when it runs to the end past a newline オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
enhancement PyCDE
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
llvm:support
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
llvm/llvm-project#226296 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
abseil/abseil-cpp#2176 ·