Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Cannot Reproduce
-
1.6-beta-1
-
None
-
None
-
groovy 1.6beta snapshot from the canoo ci server (http://build.canoo.com/groovy/artifacts/20080303213011)
Description
The current SVN Head code handles exceptions differently than groovy 1.5.4 or earlier. This change in the behavior is a breaking change for some existing code:
Example Code from the groovy-eclipse project: org.codehaus.groovy.eclipse.astviews, TreeNodeFactory.groovy, Class DefaultTreeNode#loadChildren:
try {
return TreeNodeFactory.createTreeNode(this, value."${method.name}"(), name)
} catch (org.codehaus.groovy.GroovyBugError e) {
// Some getters are not for us.
return null
} catch (NullPointerException e) {
// For some reason ClassNode.getAbstractMethods() has a problem - ClassNode.superclass is null.
return null
}
This used to work with groovy 1.5.4: after the call of createTreeNode method the groovy core class "ClassNode" sometime threw a GroovyBugError and it was possible to catch this exception.
After changing to 1.6 the exception that is thrown is not a GroovyBugError anymore, it is a InvokerInvocationException that wraps (cause field) around the GroovyBugError and therefore doesen't get caught anymore.
Attachments
Issue Links
- relates to
-
GROOVY-2643 Delegate property is ignored by closure
- Closed