As per Wikipedia, the blank final variable is a final variable whose declaration lacks an initializer at the time of definition.
At the same time, the values for switch case statement must be compile-time constant values.
As per above two affirmations, I would expect both of the below code snippets to compile with no problems, however only the first one does:
final int y = 1;
switch(1) {
case y:
}
and
final int y;
y = 1;
switch(1) {
case y:
}
Should have not Java compiler run a flow analysis in second example to ensure that blank final variable is assigned and hence compile the code with no errors?