⁠
joe: Include much more detail in inspection descriptions
- <!--
- Minecraft Development for IntelliJ
-
- https://mcdev.io/
-
- Copyright (C) 2026 minecraft-dev
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation, version 3.0 only.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
- -->
-
- <html>
- <body>
- Unnecessary mutable reference to captured local
- </body>
- </html>
- <!--
- Minecraft Development for IntelliJ
-
- https://mcdev.io/
-
- Copyright (C) 2026 minecraft-dev
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation, version 3.0 only.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
- -->
-
- <html>
- <body>
- <p>
- Unnecessary mutable reference to captured local
- </p>
- <!-- tooltip end -->
- <p>
- Reports <code>@Local</code> parameters of a <code>LocalRef</code> type whose value is only read, never set.
- </p>
- <p>
- A mutable reference makes MixinExtras wrap the local in a reference object and write its value back afterwards. If the value
- is never set, capture the local directly.
- </p>
- <pre><code>
- // bad
- private void onFoo(CallbackInfo ci, @Local LocalIntRef count) {
- System.out.println(count.get());
- }
-
- // good
- private void onFoo(CallbackInfo ci, @Local int count) {
- System.out.println(count);
- }
- </code></pre>
- </body>
- </html>