Bug 434745 - [inline] Preview for inlining local variable doesn't show resulting compile errors
Summary: [inline] Preview for inlining local variable doesn't show resulting compile e...
Status: CLOSED DUPLICATE of bug 290698
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 8
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-13 09:36 EDT by Timo Kinnunen CLA
Modified: 2019-11-26 16:48 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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