[java-highlighting] checkVariableMustBeFinal migrated

Also: intermediate refactoring inside HighlightControlFlowUtil related to init-before-use
Also: ErrorFixExtensionPoint now works for any kind (intermediate solution)
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 7a712a841a52a99bac4faafaf1164921c1150a56
This commit is contained in:
Tagir Valeev
2025-02-05 12:41:14 +00:00
committed by intellij-monorepo-bot
parent 32eeb4ee9f
commit 913cade2a5
20 changed files with 176 additions and 195 deletions
@@ -25,7 +25,7 @@ public final class ControlFlowUtil {
* @param variable variable
* @param context the context that references to the variable
* @return the scope around context that enforces variable to be effectively final. Currently, it could be
* an inner class, lambda expression, or switch guard. Returns null if there's no such scope,
* an inner class, lambda expression, or {@link PsiSwitchLabelStatementBase} for switch guard. Returns null if there's no such scope,
* or the variable declaration is within the same scope, so it should not be effectively final.
* Note that if null is returned, it doesn't mean that the variable could be modified, as another reference from
* another place might exist.