Community
Participate
Working Groups
3.0M7 int l; String s = ""; l = s.length(); System.out.println(l); Do "join variable declaration" on l. This leads to the code int l = s.length(); String s = ""; System.out.println(l); which has a compile time error. The correct code would be String s = ""; int l = s.length(); System.out.println(l);
In which way is this related to bug 54790 ???
removed dependency to bug 54790
I changed the 'Join variable' to honor the invocation point: On the variable declaration the first assigment moves up to the declaration. If invoked on the first assignment, the declaration is removed and goes down to the assignment. In both cases this can result in compile errors. To evaluate this, a deeper analysis is required, mostly resulting in no real joining at all. I find it better to leave the decition to the user. An undo is quickly performed.
Sounds like a reasonable tradeoff. Thanks.