Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse, change exception variable name in auto-generated code

Tags:

java

eclipse

This is similar to Change unhandled exception auto-generated catch code in Eclipse?

which is about changing the code that Eclipse generates for the function 'sorround with try/catch block'.

In my case, I'd like to change the variable name that is used for the exception in such code (the one referred by ${exception_var} in the template). I don't like 'e', cause sometimes it clashes with already defined variables. ex and try ( ex ) {...} would be better.

like image 825
zakmck Avatar asked Mar 04 '15 12:03

zakmck


1 Answers

In Eclipse Luna, go to Window > Preferences > Java > Code Style > Exception variable name in catch block.

like image 155
Djon Avatar answered Sep 23 '22 01:09

Djon