Summary: | [clean up][quick fix] Make 'Move else clause out of 'else'' a multi-fix | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Philip King-Cherne <Philip> | ||||
Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> | ||||
Status: | ASSIGNED --- | QA Contact: | |||||
Severity: | enhancement | ||||||
Priority: | P3 | CC: | astubbs, daniel_megert, garydgregory, markus.kell.r, martin.jaeger, neale, pwebster, sashok7241, xmlizer | ||||
Version: | 3.2 | ||||||
Target Milestone: | --- | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Philip King-Cherne
2006-08-08 23:25:09 EDT
I'm also experiencing this problem with trying to apply the quickfix to all the same javadoc problems in my file. happens consistently. Running 3.2.1. Got a whole lot of this in the log at the time i clicked "find similar": !ENTRY org.eclipse.ui.ide 4 4 2007-02-02 19:00:52.037 !MESSAGE Error accessing marker type !ENTRY org.eclipse.core.resources 4 376 2007-02-02 19:00:52.037 !MESSAGE Marker id: 752226 not found. !ENTRY org.eclipse.ui.ide 4 4 2007-02-02 19:00:52.037 !MESSAGE Error accessing marker type !ENTRY org.eclipse.core.resources 4 376 2007-02-02 19:00:52.037 !MESSAGE Marker id: 752226 not found. !ENTRY org.eclipse.ui.ide 4 4 2007-02-02 19:00:52.052 !MESSAGE Error accessing marker type !ENTRY org.eclipse.core.resources 4 376 2007-02-02 19:00:52.052 !MESSAGE Marker id: 752226 not found. !ENTRY org.eclipse.ui.ide 4 4 2007-02-02 19:00:52.052 !MESSAGE Error accessing marker type !ENTRY org.eclipse.core.resources 4 376 2007-02-02 19:00:52.052 !MESSAGE Marker id: 752226 not found. Created attachment 58214 [details]
Shows a demonstration of the bug.
This shows a demonstration of the bug. You can see that Eclipse reports the same error in several places in the document, and provides a 'quick-fix'. However, after clicking on the 'find similar problems' button, there is an extreme short delay (small fraction of a second), and the button is disabled, and the other instances of the problem have not been listed.
Similarly, I've got a situation where my Problems view shows "Unhandled exception type BlahException" for several instances in the same source file, and "find similar problems" does not find the others in the same file. I think that the pattern for multiple quickfixes here is ineffective. What I want to do is to select a group of items in the Problems view, and click "Quick fix" and select the same solution for all of those. I even think that this feature was removed for 3.4 and 3.5. If this is the case I will raise a feature request for the "find similar problems" feature again. Do anyone knows if the "find similar problems" feature was removed by intention? (In reply to comment #4) > I even think that this feature was removed for 3.4 and 3.5. If this is the case > I will raise a feature request for the "find similar problems" feature again. > Do anyone knows if the "find similar problems" feature was removed by > intention? It is there. Select a marker in the Problems view and use Quick Fix. That opens a dialog that tries to collect similar problems. PW The view was reworked in 3.4. Anyways, the feature to look up similar problems is still there and works well. It requires the fix/resolution to be a Multi-fix; see org.eclipse.ui.views.markers. WorkbenchMarkerResolution. findOtherMarkers(IMarker[]). It really depends on the code providing the resolution to implement it that way (see extension point org.eclipse.ui.ide.markerResolution) . See Comment 6, also the multi-fix is handled by QuickFix without any user intervention. I guess the fixes are contributed by JDT. Adding Dani for comment. >I guess the fixes are contributed by JDT.
You're right Hitesh.
Multi-fix support is implemented on a case by case basis, depending how safe the quick fix is.
I agree that the 'Move else clause out of 'else'' quick fix could be a multi-fix. Moving to JDT UI.
*** Bug 408332 has been marked as a duplicate of this bug. *** *** Bug 429238 has been marked as a duplicate of this bug. *** *** Bug 486625 has been marked as a duplicate of this bug. *** Implementation also has to work with nested if statements, e.g.: void foo(boolean a, boolean b) { if (a) { System.out.println("a"); return; } else { System.out.println("b"); if (b) { System.out.println("c"); return; } else { System.out.println("d"); } } } |