JVM Knowledge
  • V is [un]assigned after a switch statement (§14.11) iff all of the following are true:

    • V is [un]assigned before every break statement (§14.15) that may exit the switch statement.
    • For each switch rule (§14.11.1) in the switch block, V is [un]assigned after the switch rule expression, switch rule block, or switch rule throw statement introduced by the switch rule.
    • If there is a switch labeled statement group in the switch block, then V is [un]assigned after the last block statement of the last switch labeled statement group.
    • If there is no default label in the switch block, or if the switch block ends with a switch label followed by the } separator, then V is [un]assigned after the selector expression.
  • V is [un]assigned before the selector expression of a switch statement iff V is [un]assigned before the switch statement.

  • V is [un]assigned before the switch rule expression, switch rule block, or switch rule throw statement introduced by a switch rule in the switch block iff V is [un]assigned after the selector expression of the switch statement.

  • V is [un]assigned before the first block statement of a switch labeled statement group in the switch block iff both of the following are true:

    • V is [un]assigned after the selector expression of the switch statement.
    • If the switch labeled statement group is not the first in the switch block, V is [un]assigned after the last block statement of the preceding switch labeled statement group.
  • V is [un]assigned before a block statement that is not the first of a switch labeled statement group in the switch block iff V is [un]assigned after the preceding block statement.