Community
Participate
Working Groups
When using the inline local variable wizard the preview doesn't show compile errors that can be caused by the refactoring. To observe, inline one of the variables in this example code: private static void test3(int[] array) { Serializable array1 = array; Cloneable array2 = array; out(array1); out(array2); // inlining produces out(array); out(array); } private static void out(Serializable object) { System.out.println(object); } private static void out(Cloneable object) { System.out.println(object); } The resulting code doesn't compile but unlike Extract Local Variable refactoring this fact isn't displayed in the preview.
Similar to bug 290698. Inline refactoring doesn't show compiler errors in preview and thus allows user to perform the refactoring resulting in file with compiler errors. *** This bug has been marked as a duplicate of bug 290698 ***
The "inline local variable" case was solved by https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=90d3db9ee97bf8a8f8586b6d8925204565439070