paulk-asert opened a new pull request, #3111:
URL: https://github.com/apache/groovy/pull/3111

   …shSet or ArrayList throws a bare ClassCastException
   
   The cast selector's collection fast path tested the subtype relation the 
wrong way round, so it never fired for Set, AbstractSet, Collection or List 
targets. It fired only for an abstract subclass of HashSet or ArrayList, where 
it built a plain HashSet or ArrayList that then failed the cast with a 
ClassCastException instead of a GroovyCastException.
   
   Remove the fast path so every collection cast goes through 
DefaultTypeTransformation.castToType, as classic call sites do. A corrected 
fast path would have diverged from classic call sites (HashSet instead of 
LinkedHashSet for a Set target). The unused HASHSET_CONSTRUCTOR and 
ARRAYLIST_CONSTRUCTOR handles are deprecated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to