groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Павел Новиченко (JIRA) <j...@apache.org>
Subject [jira] [Updated] (GROOVY-7867) asType(Collection col, Class clazz) ingnores exceptions in clazz constructor
Date Fri, 17 Jun 2016 12:20:05 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-7867?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Павел Новиченко updated GROOVY-7867:
------------------------------------
    Description: 
Method ignores exception in clazz constructor, and if any - throws exception later, when try
find constructor with args matches collection items.

public static <T> T asType(Collection col, Class<T> clazz) in DefaultGroovyMethods.java,
line 10623:
{code:title=DefaultGroovyMethods.java|borderStyle=solid}
        Object[] args = {col};
        try {
            return (T) InvokerHelper.invokeConstructorOf(clazz, args);
        } catch (Exception e) {
            // ignore, the constructor that takes a Collection as an argument may not exist
        }
{code}

  was:
Method ignores exception in clazz constructor, and if any - throws exception later, when try
find constructor with args matches collection items.

public static <T> T asType(Collection col, Class<T> clazz) in DefaultGroovyMethods.java,
line 10623:
{code:title=DefaulktGroovyMethods.java|borderStyle=solid}
        Object[] args = {col};
        try {
            return (T) InvokerHelper.invokeConstructorOf(clazz, args);
        } catch (Exception e) {
            // ignore, the constructor that takes a Collection as an argument may not exist
        }
{code}


> asType(Collection col, Class clazz) ingnores exceptions in clazz constructor
> ----------------------------------------------------------------------------
>
>                 Key: GROOVY-7867
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7867
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.x, 2.5.0-beta-1
>         Environment: no matter
>            Reporter: Павел Новиченко
>             Fix For: 2.x
>
>
> Method ignores exception in clazz constructor, and if any - throws exception later, when
try find constructor with args matches collection items.
> public static <T> T asType(Collection col, Class<T> clazz) in DefaultGroovyMethods.java,
line 10623:
> {code:title=DefaultGroovyMethods.java|borderStyle=solid}
>         Object[] args = {col};
>         try {
>             return (T) InvokerHelper.invokeConstructorOf(clazz, args);
>         } catch (Exception e) {
>             // ignore, the constructor that takes a Collection as an argument may not
exist
>         }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message