Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 138612

Summary: [Markers] problems view quick fix of multiple identical warnings does not work
Product: [Eclipse Project] Platform Reporter: Peter Larsen <peblpebl>
Component: IDEAssignee: Tod Creasey <Tod_Creasey>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: eclipse, remy.suen
Version: 3.1Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Peter Larsen CLA 2006-04-26 09:06:17 EDT
I have severel identical errors in different classes. I cannot
mark them all and quick fix them. 

If I quick fix just one, I get a window with the option of
"find simular problems" which does nothing.
Comment 1 Tod Creasey CLA 2006-04-26 10:05:46 EDT
You can you give an example of a fixes that should be the same? If we are not finding matching problems a bug needs to be logged to JDT with an example to see if they can do it.

*** This bug has been marked as a duplicate of 124614 ***
Comment 2 Tod Creasey CLA 2006-05-29 12:29:05 EDT
Here is the example that does not work

Test example of identical problems but not found under "find similar problems".
(The declared exception IOException is not actually thrown by the method
sameproblem1() ...)


import java.io.IOException;

public class EclipseIdenticalBugs {
        public void sameproblem1() throws IOException {}
        public void sameproblem2() throws IOException {}
}
Comment 3 Volker Wegert CLA 2008-02-16 07:41:24 EST
I've got the same behaviour here with 3.4M5 - both in JDT and PDE environments. For example, I just checked out the EMF sources and got tons of "Plug-ins declaring extensions or extension points must set the singleton directive to true" messages. I can select all of them and issue "Quick Fix" in the problems view, but the resulting dialog only resolves one of the issues and leaves the other ones untouched. Do I have to mention that it's rather annoying to "right click - Cmd-1 - Enter" through 50-odd errors? ;-)
Comment 4 Remy Suen CLA 2008-02-16 08:26:30 EST
If you have multiple strings that haven't been externalized and you try to invoke quick fix on them, they do all show up on the dialog. However, in an alternate scenario like multiple private fields that aren't being used, invoking quick fix will present the user with three different resolutions. Only in the field removal resolution are all the selections displayed. The other resolutions will only show the first selection.

Tod, do you think this is a JDT problem?
Comment 5 Peter Larsen CLA 2008-02-18 08:29:07 EST
The "find simular problems" is gone since I reported this bug.
But I get same behaviour as comment #3.

Another test case:

public class UnnecessarySemicolon {
	public void semi1() {/**/};
	public void semi2() {/**/};
}

Marking both problems view will bring up a dialog suggesting to
solved only the _first_ marked. (change the sorting
and the other is shown).
Comment 6 Tod Creasey CLA 2008-02-19 08:08:25 EST
No this is a problem with the fact that applying a fix usually changes line numbers so JDT can only multi apply the NL fix.

I have removed the multi-select enable in M6 because this is confusing people. See Bug 212599
Comment 7 Volker Wegert CLA 2008-03-07 16:18:08 EST
Just to make sure I get this right - you're talking about JDT only. Is there a chance that other parts of Eclipse - like PDE - implement something like a "mass quick fixer"? For a motivation see comment #3 - it is really annoying to fix this manually after checking out tons of plug-ins. Should I open a new bug in PDE to ask for this?
Comment 8 Tod Creasey CLA 2008-03-11 09:26:45 EDT
No - we are talking about any fix where the contents would change as a result of the fix so it could happen anywhere.

Comment 9 Peter Larsen CLA 2008-03-11 09:40:08 EDT
I too would say that it is really annoying to correct 100+ of
Unnecessary Semicolon warnings one by one. 

I still do not grasp why
>>
No this is a problem with the fact that applying a fix usually changes line
numbers so JDT can only multi apply the NL fix.
<<
is valid. Does removing semicolons change the line numbers. 

Why not correct the fixes in reverse starting from highest line number?