| 1 |
import java.util.Map; |
| 2 |
import org.checkerframework.checker.nullness.qual.Nullable; |
| 3 |
|
| 4 |
// Test case for Issue 173 |
| 5 |
// https://github.com/typetools/checker-framework/issues/173 |
| 6 |
public abstract class MyMap<K, V> implements Map<K, V> { |
| 7 |
@Override |
| 8 |
// :: error: (contracts.postcondition.not.satisfied) |
| 9 |
public @Nullable V put(K key, V value) { |
| 10 |
return null; |
| 11 |
} |
| 12 |
|
| 13 |
@Override |
| 14 |
public void putAll(Map<? extends K, ? extends V> map) { |
| 15 |
for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) { |
| 16 |
put(entry.getKey(), entry.getValue()); |
| 17 |
} |
| 18 |
} |
| 19 |
} |