Project: JDT
Bug 190464 [rulers] Quickfix can sometimes be Go To Annotation
Reported: 2007-06-01 09:21:46 | Status: verified fixed

This is 100% repeatable, but I'm not sure if I can explain it well enough... 1) Open an editor on the class org.eclipse.ui.actions.RenameResourceAction 2) Find the line that looks like: textEditor = new Text(textEditorParent, SWT.NONE); 3) Replace that line with this code: if ("carbon".equals(SWT.getPlatform())) { textEditor = new Text(textEditorParent, SWT.BORDER); } else { textEditor = new Text(textEditorParent, SWT.NONE); } 4) Save the file. You should see an error marker on the first line of the change , since there is no non-nls tag. 5) Pop up the menu on the error marker and you will see "Quick Fix" (this is correct behavior). 6) Put the cursor after the third close bracket on the first line and hit one more close bracket, so the line looks like this: if ("carbon".equals(SWT.getPlatform()))) { 7) Now, if you pop up the menu on the error marker and you will see that the "Quick Fix" item has been replaced with "Go to Annotation" and it is *enabled*. 8) Selecting this menu item does nothing. The behavior appears to be very sensitive to what you do. For example, if you save the file after step 6), the menu item is correct. Similarly, if you remove a bracket instead of adding one in step 6), the menu is correct even if you don't save the file.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaSelectAnnotationRulerAction.java