ListAsArray.containsAll() invokes List.contain() method instead of List.containsAll()

Description

I'm working on porting some ACF code to Lucee. This code uses the (non-supported) containsAll() member method on arrays to check if all the items from array1 exist in array2.

In Lucee, I noticed the method exists, but returns the wrong values.

Looking at the Lucee source code, I see that the ListAsArray.java implements the containsAll() method as:

@Override public boolean containsAll(java.util.Collection c) { return list.contains(c); }

This looks like a bug to me. It would appear that it should be calling ist.containsAll(c) instead of ist.contains(c).

Here's a Gist that shows of the issue:

https://www.trycf.com/gist/dbcf1cc8f40f1a50711644ecfc7c45ab/

In ACF10+ the code returns true, where in Lucee 5 it returns false.

Environment

None

Activity

Pothys - MitrahSoft 
8 September 2020 at 06:49

, I made a test with fixed version 5.3.8.62-SNAPSHOT. It works fine as expected.

Pothys - MitrahSoft 
1 September 2020 at 06:38

I've checked this ticket and the issue happened on lucee. So, I added a testcase and fix for this ticket.

Pull request: https://github.com/lucee/Lucee/pull/1015

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 28 August 2020 at 17:34
Updated 8 September 2020 at 06:49
Resolved 8 September 2020 at 06:49