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 following code throws ClassCastException:
Error:
The culprit is this return statement:
The
copyOf
variant used here assumes thatresult
containsComparable
elements, but that's not the case forMap.Entry
. Therefore the method throws CCE as soon asresults
contains more than one element.We didn't detect this because
CompositeDriverConfigTest
is not testing theCompositeDriverExecutionProfil.entrySet
method.The fix is trivial: