Regression: CollectionType.replace() breaks if target is PersistentCollection, but not instance of Collection (e.g. PersistentMap)

Description

As written in the title. If the parameter target of the method CollectionType.replace is for example of type PersistentMap, a ClassCastException is thrown.

Commit seems to be the problem here. Since MapType.replace doesn’t override CollectionType.replace, this code is missing a check if target is a collection, and, optionally, some special handling for the case where it isn’t.

Partial Trace:

Activity

Show:

Arne Theß November 11, 2024 at 3:20 PM

Ah, great. Thanks.

Andrea Boriero November 11, 2024 at 3:01 PM

I managed to create a test case

Andrea Boriero November 11, 2024 at 2:33 PM

Thanks

Arne Theß November 11, 2024 at 1:05 PM

We ran into this problem in an edge case in a relatively big project. I’ll probably be able to construct a test case for this, but it will likely take a day or three until I find the time to do that.

Andrea Boriero November 11, 2024 at 1:01 PM

Hi ,

can you please provide a test case? it would be really helpful.

Thanks

Fixed

Details

Assignee

Reporter

Worked in

Fix versions

Affects versions

Priority

Created November 11, 2024 at 12:54 PM
Updated November 21, 2024 at 5:31 PM
Resolved November 21, 2024 at 4:49 PM