The compiler does not make that assumption be cause the compiler knows nothing about what will be going on at run time. In a multi-threaded environment, another
thread could change the value of int i between the time it gets set to 100 and the time that byte b is assigned that value.
By making i final, the compiler knows that it cannot change. And since it's being set to a literal value, the compiler can substitute that literal value anywhere it sees the variable.
Granted, if both are local variables, that's not an issue, but extra logic checks like that increase compilation time. I would be just as happy to not heve them, myself.
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.