Project: JDT
Bug 106691 [templates] Code Assist ignores prefered name of exception variable
Reported: 2005-08-10 16:10:44 | Status: resolved fixed

I have changed the "Exception variable name in catch blocks" to "ex" in the global preferences, under Window->Preferences->Java->CodeStyle. But this does not seam to function when I use code assist to create try-catch blocks. I tried out two scenarios: 1. Begin typing "tr" and then use code assist to expand it to a try-catch block. 2. Write a statement which is able to throw an Exception (eg. "throw new Exception()"), and wait for the report of an error ("uncaught exception Exception"). I then use code assist to wrap this statement with a try-catch block. In both cases, neither the presented code assist choice, nor the resulting try-catch block shows my prefered variable name "ex", but the old default value "e".

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/ExceptionVariableNameResolver.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/JavaContext.java