Community
Participate
Working Groups
Build ID: M20071023-1652 Steps To Reproduce: Test case: public class A { void m() { int y; int z; //from try { if(3==3) y = 1; else throw new Exception("boo"); } catch(Throwable t) { y=2; } z=y; //to } } If we extract the statements between //from and //to into a method, Eclipse infers the local variable y to be live and passes it as a parameter to the newly created method. In fact, however, y is not live, so the resulting code does not compile due to a violation of the definite assignment restriction. More information:
I guess this has to do with the implicit initialization to 0 and that y is read later. Looks like a detail to me. I'm tempted to accept that and set to WONTFIX. Comments?
What do you mean by implicit initialization to 0? y is a local variable, so it is not initialized to anything, right?
You're right...! Have to investigate here...