Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.9-beta-1
-
Component/s: bytecode, class generator, parser, parser-antlr
-
Labels:None
-
Number of attachments :
Description
John Wilson suggested this improved syntax for catching several exceptions at once:
This has been suggested for Java
http://members.capmac.org/~orb/blog.cgi/tech/java/Better_exception_sy.html
I would have thought it's trivial to do in Groovy
try { Field field = someClass.getDeclaredField(someField); someValue = field.getInt(Barcode.class); } catch (SecurityException, NoSuchFieldException e) { // do something else with the exception }
Activity
Guillaume Laforge
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Description |
John Wilson suggested this improved syntax for catching several exceptions at once: This has been suggested for Java http://members.capmac.org/~orb/blog.cgi/tech/java/Better_exception_sy.html I would have thought it's trivial to do in Groovy try { Field field = someClass.getDeclaredField(someField); someValue = field.getInt(Barcode.class); } catch (SecurityException, NoSuchFieldException e) { // do something else with the exception } |
John Wilson suggested this improved syntax for catching several exceptions at once: This has been suggested for Java http://members.capmac.org/~orb/blog.cgi/tech/java/Better_exception_sy.html I would have thought it's trivial to do in Groovy {code} try { Field field = someClass.getDeclaredField(someField); someValue = field.getInt(Barcode.class); } catch (SecurityException, NoSuchFieldException e) { // do something else with the exception } {code} |
Guillaume Laforge
made changes -
| Fix Version/s | 1.8-beta-x [ 15750 ] | |
| Fix Version/s | 2.0 [ 13489 ] |
Cedric Champeau
made changes -
| Attachment | Added_support_for_multicatch_(GROOVY-1984).patch [ 53743 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.9-beta-1 [ 17153 ] | |
| Fix Version/s | 1.8.x [ 15750 ] |
Guillaume Laforge
made changes -
| Assignee | Cédric Champeau [ melix ] |
Guillaume Laforge
made changes -
| Status | Open [ 1 ] | Closed [ 6 ] |
| Resolution | Fixed [ 1 ] |
Cedric Champeau
made changes -
| Resolution | Fixed [ 1 ] | |
| Status | Closed [ 6 ] | Reopened [ 4 ] |
Cedric Champeau
made changes -
| Attachment | Support_for_final_modifier.patch [ 54353 ] |
Guillaume Laforge
made changes -
| Status | Reopened [ 4 ] | Closed [ 6 ] |
| Resolution | Fixed [ 1 ] |
See the thread on the mailing-list for further suggestions:
http://www.nabble.com/Multiple-exception-types-in-a-single-catch-block-tf4086071.html