You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2019/02/21 06:19:02 UTC
[jira] [Closed] (GROOVY-8238) multiple-catch statement behaves
strangely
[ https://issues.apache.org/jira/browse/GROOVY-8238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-8238.
-----------------------------
> multiple-catch statement behaves strangely
> ------------------------------------------
>
> Key: GROOVY-8238
> URL: https://issues.apache.org/jira/browse/GROOVY-8238
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 2.4.6
> Environment: Windows 10
> Reporter: Gert Grossmann
> Assignee: Paul King
> Priority: Major
> Fix For: 2.5.6, 3.0.0-alpha-5
>
>
> {code:java}
> try {
> throw new AnyJavaException()
> } catch ( AnyJavaException1 | AnyJavaException2 e ) {
> println e.message
> }
> {code}
> This works as expected. But following does not:
> {code:java}
> try {
> throw new AnyJavaException()
> } catch ( AnyJavaException | AnyGroovyException e ) {
> println e.message
> }
> {code}
> You get:
> {noformat}
> java.lang.ClassCastException: AnyJavaException cannot be cast to groovy.lang.GroovyObject
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)