Bug 335700 - [code templates] Allow to mark exception variable 'final' when generating try/catch
Summary: [code templates] Allow to mark exception variable 'final' when generating try...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-28 11:06 EST by Rodney Beede CLA
Modified: 2011-01-31 04:38 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rodney Beede CLA 2011-01-28 11:06:04 EST
Build Identifier: 20100917-0705

When I do a Quick Fix on Java code and select Surround with try/catch it provides a default try catch block.  I like to make the catch parts look like catch(final Exception excep) {

I tried modifying the templates for try and catch in Windows, Preferences but that didn't affect the Quick Fix Surround with try/catch.  I prefer the Quick Fix one because it fills in multiple exceptions and each type quickly over the user-defined template ones.

A setting in Preferences where I can change the template used for Quick Fix Surround with try/catch would be great.

Reproducible: Always

Steps to Reproduce:
1.  Write a line of Java that throws an exception (not RuntimeException)
2.  Focus the cursor on the line
3.  Bring up Quick Fix (ctrl+1 on Windows)
4.  Select Surround with try/catch

Notice that regardless of your template settings in preferences for try and catch that a built-in mode is used.