Project: JDT
Bug 365041 Similar named entries in Surround with menu cause confusion
Reported: 2011-11-29 06:25:21 | Status: verified fixed

In the Surround With menu there are two (confusing) items 1. Try/catch Block - uses 'Code Templates' 2. try (try catch block) - based on 'Editor Templates' The first one invokes the Surround With 'Refactoring' which will find the exact exceptions thrown from the selection and use those in the catch block. The second one, which uses the editor template, always uses 'Exception' in the catch block. => This can be quite confusing. Solution 1. Use icons in the Surround With menu a) The 'green arrow' we use for Quick Assists can be used to indicate that the action is a refactoring b) In Content Assist popup we use an icon to indicate template proposals, the same icon can be used here. 2. 'Configure Templates' action should also show the 'Code Template' node.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/SurroundWithActionGroup.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/SurroundWithTemplateMenuAction.java