Re: Format of try ... catch blocks


danielb987
 

Go to menu item: Tools / Options. Select "Editor". Select the tab "Formatting". Select Language "Java" and Category "Alignment". There you have a checkbox "catch". Is that checkbox checked?

Daniel

2020-05-24 06:55 skrev Dave Heap:

The "Format" command in NetBeans 11.3 has suddenly decided to change
the format of try ... catch blocks from:
try {
...
} catch (...) {
...
}
to:
try {
...
}
catch (...) {
...
}
The latter is the style used by Oracle at:
<https://docs.oracle.com/javase/tutorial/essential/exceptions/try.html>;
However, Checkstyle is now complaining about the change.
Have we changed a project setting? I seem to remember some discussion
of this topic recently but can't find it.
Dave
Links:
------
[1] https://jmri-developers.groups.io/g/jmri/message/3459
[2] https://groups.io/mt/74432823/1303822
[3] https://jmri-developers.groups.io/g/jmri/post
[4] https://jmri-developers.groups.io/g/jmri/editsub/1303822
[5] https://jmri-developers.groups.io/g/jmri/leave/defanged

Join jmri@jmri-developers.groups.io to automatically receive all group messages.