Skip to content

Commit 0ed838c

Browse files
committed
fix new test; can not figure out type params for static methods
1 parent dae5440 commit 0ed838c

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/test/java/com/fasterxml/jackson/failing/TypeRefinementForMap1215Test.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,20 @@ static class MyHashMap<K, V extends HasUniqueId<K>>
5757
extends LinkedHashMap<K, V>
5858
implements AnotherMap<K, V>
5959
{
60-
@JsonCreator
61-
public static <K, V extends HasUniqueId<K>> MyHashMap<K, V> fromArray(V[] values) {
62-
MyHashMap<K, V> map = new MyHashMap<K, V>();
60+
@JsonCreator(mode=JsonCreator.Mode.DELEGATING)
61+
public MyHashMap(V[] values) {
6362
for (int i = 0; i < values.length; i++) {
6463
V v = values[i];
6564
if (v.getId() == null) {
6665
throw new RuntimeException("Failed to get id");
6766
}
68-
if (map.containsKey(v.getId())) {
67+
if (containsKey(v.getId())) {
6968
throw new RuntimeException("Conflict on id");
7069
}
71-
map.put(v.getId(), v);
70+
put(v.getId(), v);
7271
}
73-
return map;
7472
}
75-
76-
public MyHashMap() { }
77-
73+
7874
@Override
7975
public void add(V v) {
8076
if (containsKey(v.getId())) {

0 commit comments

Comments
 (0)