Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Cannot Reproduce
-
Affects Version/s: 1.6-beta-1
-
Fix Version/s: 1.6-beta-1
-
Component/s: None
-
Labels:None
-
Environment:groovy 1.6beta snapshot from the canoo ci server (http://build.canoo.com/groovy/artifacts/20080303213011)
-
Number of attachments :
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."$
"(), 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.
Issue Links
- relates to
-
GROOVY-2643
Delegate property is ignored by closure
-
sorry...code looks nicer like this