Community
Participate
Working Groups
When implementing a quick fix via WorkbenchMarkerResolution, using it from the problems view causes the quick-fix to appear twice. I tracked it down to the QuickFixHandler, where containsAllButFirst seems to have a bug. To my understanding, containsAllButFirst should return true when the "extend" contains all elements of "members", but not the first one. However, if members CONTAINS the first one, it still returns true.
I have to correct myself, the duplicate appearance of the marker happens in the "if" block, where the following happens: markers.add(firstSelectedMarker); markers.addAll(Arrays.asList(other)); Those statements should be reversed and the markers.add(firstSelectedMarker); should only be called if markers does not already contain the firstSelectedMarker.
New Gerrit change created: https://git.eclipse.org/r/46459
Created attachment 252752 [details] Plugin-Project for testing The plugin contains a subclass of WorkbenchMarkerResolution which accepts everything as otherMarker. I used the Plugin to test the Bugfix To use the plugin for testing: 1. Import Plugin into eclipse and start it 2. Create a new Java-Project in test-environment and create a Java-File which contains multiple Errors (or use the test class) 3. Click in the Problem-View on the Error an select Quick-Fix 4. Select "Test Resolution" Test class: package testProject; import java.util.Collection; public class testClass { public void name() { Collection demo = new ArrayList(); Collection testBla = new ArrayList(); } }
Gerrit change https://git.eclipse.org/r/46459 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=b86d5d5882350979d76aa5b3487e87d712a72ae4
Thanks Jan-Ove for the contribution.
*** Bug 391711 has been marked as a duplicate of this bug. ***