Composite driver configs with more than 1 key throw ClassCastException

Description

The following code throws ClassCastException:

Error:

The culprit is this return statement:

The copyOf variant used here assumes that result contains Comparable elements, but that's not the case for Map.Entry. Therefore the method throws CCE as soon as results contains more than one element.

We didn't detect this because CompositeDriverConfigTest is not testing the CompositeDriverExecutionProfil.entrySet method.

The fix is trivial:

Environment

None

Pull Requests

None

Activity

Show:
Alex Dutra
October 3, 2020, 11:29 AM

Turns out there is also a NullPointerException possible in CompositeDriverExecutionProfile.entrySet() when one of the profiles is null.

And speaking of profiles, they are nullable and volatile, so there is a possible race condition in a few places in CompositeDriverExecutionProfile.

Will fix those as well.

Fixed

Assignee

Alex Dutra

Reporter

Alex Dutra

Affects versions

Fix versions