Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14c4f147 authored by Julia Sullivan's avatar Julia Sullivan
Browse files

Use LinkedHashMap for sNamedColorSpaces.

This previously used a HashMap, which returns
an unordered list for the values() function.
The ColorSpace.match function will get that
list and then try to match on it. Because
multiple color spaces can match to the same
input arguments, this means it would randomly
return one of the matching color spaces.
This lead the testMatch function in the cts test
to be flaky.

By switching to a LinkedHashMap, this returns
a sorted values() list so the function
will consistently return the same value for
the same input.

This primarily affects the host JVM, where HashMap
iteration behavior seems to be slightly different
than on libcore.

Test: Tested in Robolectric and the cts test.
Change-Id: I6c4882a2649fc639c4c24aded302bef2c58cbf06
Bug: b/416031802
Flag: EXEMPT bugfix
parent fbc1309a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment