You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Huss (JIRA)" <ji...@apache.org> on 2016/12/20 01:40:58 UTC
[jira] [Closed] (GROOVY-8027) Unexpected ClassCastException in
multi-catch including java.lang.Error
[ https://issues.apache.org/jira/browse/GROOVY-8027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Huss closed GROOVY-8027.
-------------------------------
Resolution: Duplicate
> Unexpected ClassCastException in multi-catch including java.lang.Error
> ----------------------------------------------------------------------
>
> Key: GROOVY-8027
> URL: https://issues.apache.org/jira/browse/GROOVY-8027
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.7
> Environment: Java 1.8.0_66
> Reporter: Daniel Huss
>
> {code}
> import groovy.transform.CompileStatic
> @CompileStatic
> class Example {
> public static void main( String[] args ) {
> try {
> throw new RuntimeException( "ok" )
> } catch ( RuntimeException | Error e ) {
> println "${e.class.simpleName} : ${e.message}"
> }
> }
> }
> {code}
> Expected output: {{RuntimeException : ok}}
> Actual output: {{Exception in thread "main" java.lang.ClassCastException: java.lang.RuntimeException cannot be cast to java.lang.Error}}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)