Bug 411801 - [quick fix] Unable to perform multi-fix 'Remove '@Override' annotation'
Summary: [quick fix] Unable to perform multi-fix 'Remove '@Override' annotation'
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-27 12:46 EDT by Blessed Geek CLA
Modified: 2013-07-09 06:17 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Blessed Geek CLA 2013-06-27 12:46:11 EDT
I am using Juno 4.2.2. I am certain this problem had existed since antiquity (actually ever since multiple quick fix became a feature).


I have four errors within the same Java source file. The reason for the error was that the code was developed on JDK 1.6 which allows @override annotation on interface implementation. The source file was then merged with a JDK 1.5 workspace.

Consequently, these errors were listed on the [Problems] pane.

The method onSelection(SelectionEvent<Genx<TypA>>) of type new SelectionHandler<Genx<TypA>>(){} must override a superclass method

The method onSelection(SelectionEvent<Genx<TypB>>) of type new SelectionHandler<Genx<TypB>>(){} must override a superclass method

The method onSelection(SelectionEvent<Genx<TypC>>) of type new SelectionHandler<Genx<TypC>>(){} must override a superclass method

The method onSelection(SelectionEvent<Genx<TypD>>) of type new SelectionHandler<Genx<TypD>>(){} must override a superclass method


Steps:

1. Right-click on each problem and perform quick fix - the quick fix would be completed unimpeded to completion.

2. Select all four and right-click to quick fix - a Quick Fix dialog pops up to inform me that ...

The selected problems do not have a common applicable quick fix.
Only select similar problems or try Source > Clean Up to fix multiple problems at once.


Explanation/Discussion:
These are obviously similar problems. Not just similar but stupendously similar.
The algorithm to detect similar quick-fixable problems is insufficient or defective.

I normally do not wish to perform a Clean up to fix the whole project or workspace, for reasons beyond the scope of this bug. I wish to have more control to choose what I wish to fix.
Comment 1 Noopur Gupta CLA 2013-06-28 06:14:59 EDT
Multi quick fix does not work with following example also when when used with JDK 1.5:
------------------------------------
public interface I {
	void foo();
}

abstract class C implements I {
}

class Test {
	C o1 = new C() {
		@Override
		public void foo() {
		}
	};

	C o2 = new C() {
		@Override
		public void foo() {
		}
	};
}
------------------------------------
Multi-fix support is implemented on a case by case basis and is not implemented for the quick fix: Remove '@Override' annotation.

Dani/Markus, is this quick fix a candidate for multi-fix?