Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 3.x, 2.5.0-beta-1
-
None
-
no matter
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:
DefaultGroovyMethods.java
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 }
In my opinion, should ignore only if such constroctor not found