Bug 434745

Summary: [inline] Preview for inlining local variable doesn't show resulting compile errors
Product: [Eclipse Project] JDT Reporter: Timo Kinnunen <timo.kinnunen>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: manju656, pyvesdev
Version: 4.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows 8   
See Also: https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=90d3db9ee97bf8a8f8586b6d8925204565439070
Whiteboard:

Description Timo Kinnunen CLA 2014-05-13 09:36:17 EDT
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.
Comment 1 Martin Mathew CLA 2014-05-14 23:05:58 EDT
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 ***
Comment 2 Pierre-Yves Bigourdan CLA 2019-11-26 16:48:07 EST
The "inline local variable" case was solved by https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=90d3db9ee97bf8a8f8586b6d8925204565439070