diff options
| author | Nikita Iashchenko <nikitai@google.com> | 2019-01-15 19:56:10 +0000 |
|---|---|---|
| committer | Nikita Iashchenko <nikitai@google.com> | 2019-01-17 17:56:05 +0000 |
| commit | b00f38019f006e144718e1036cfdb7abd46c617b (patch) | |
| tree | a7afe1ceace1265cefafc81559277f9b3d2bc199 /annotations/generate_annotated_java_files.py | |
| parent | 9684d3fc5309347191685140ff9aa303c25e7715 (diff) | |
Test LinkedHashMap.removeEldestEntry() implementation that modifies underlying map
The documentation for LinkedHashMap.removeEldestEntry() states:
> <p>This method typically does not modify the map in any way,
> instead allowing the map to modify itself as directed by its
> return value. It <i>is</i> permitted for this method to modify
> the map directly, but if it does so, it <i>must</i> return
> <tt>false</tt> (indicating that the map should not attempt any
> further modification). The effects of returning <tt>true</tt>
> after modifying the map from within this method are unspecified.
This CL adds a test coverage for the case when removeEldestEntry()
modifies underlying map, such as:
- Removing from map by key
- Removing from map by both key and value
- Removing from order-accessed map (rather than insertion-order)
- Removing from map by other than passed eldest entry
Bug: 71498231
Test: atest core-tests:libcore.java.util.LinkedHashMapTest
Change-Id: I12ff2592b6c640c0d96c1d92d5d93d26b4e7cf21
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions
