Skip to content

Commit 257ec52

Browse files
committed
Fix #506
1 parent 90cb874 commit 257ec52

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

release-notes/VERSION-2.x

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ JSON library.
2626
#495: Create `StreamReadFeature` to move non-json specific `JsonParser.Feature`s to
2727
#496: Create `StreamWriteFeature` to take over non-json-specific `JsonGenerator.Feature`s
2828
#502: Make `DefaultPrettyPrinter.createInstance()` to fail for sub-classes
29+
#506: Add missing type parameter for `TypeReference` in `ObjectCodec`
2930

3031
2.9.8 (15-Dec-2018)
3132

src/main/java/com/fasterxml/jackson/core/JsonParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ public <T> Iterator<T> readValuesAs(Class<T> valueType) throws IOException {
17931793
* Method for reading sequence of Objects from parser stream,
17941794
* all with same specified value type.
17951795
*/
1796-
public <T> Iterator<T> readValuesAs(TypeReference<?> valueTypeRef) throws IOException {
1796+
public <T> Iterator<T> readValuesAs(TypeReference<T> valueTypeRef) throws IOException {
17971797
return _codec().readValues(this, valueTypeRef);
17981798
}
17991799

src/main/java/com/fasterxml/jackson/core/ObjectCodec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public abstract <T> T readValue(JsonParser p, Class<T> valueType)
5656
* and specifically needs to be used if the root type is a
5757
* parameterized (generic) container type.
5858
*/
59-
public abstract <T> T readValue(JsonParser p, TypeReference<?> valueTypeRef)
59+
public abstract <T> T readValue(JsonParser p, TypeReference<T> valueTypeRef)
6060
throws IOException;
6161

6262
/**
@@ -79,7 +79,7 @@ public abstract <T> Iterator<T> readValues(JsonParser p, Class<T> valueType)
7979
* Method for reading sequence of Objects from parser stream,
8080
* all with same specified value type.
8181
*/
82-
public abstract <T> Iterator<T> readValues(JsonParser p, TypeReference<?> valueTypeRef)
82+
public abstract <T> Iterator<T> readValues(JsonParser p, TypeReference<T> valueTypeRef)
8383
throws IOException;
8484

8585
/**

src/test/java/com/fasterxml/jackson/core/json/JsonFactoryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public <T> T readValue(JsonParser p, Class<T> valueType) throws IOException {
2020
}
2121

2222
@Override
23-
public <T> T readValue(JsonParser p, TypeReference<?> valueTypeRef) throws IOException {
23+
public <T> T readValue(JsonParser p, TypeReference<T> valueTypeRef) throws IOException {
2424
return null;
2525
}
2626

@@ -35,7 +35,7 @@ public <T> Iterator<T> readValues(JsonParser p, Class<T> valueType) throws IOExc
3535
}
3636

3737
@Override
38-
public <T> Iterator<T> readValues(JsonParser p, TypeReference<?> valueTypeRef) throws IOException {
38+
public <T> Iterator<T> readValues(JsonParser p, TypeReference<T> valueTypeRef) throws IOException {
3939
return null;
4040
}
4141

src/test/java/com/fasterxml/jackson/core/util/TestDelegates.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public <T> T readValue(JsonParser p, Class<T> valueType) {
2929
return null;
3030
}
3131
@Override
32-
public <T> T readValue(JsonParser p, TypeReference<?> valueTypeRef) {
32+
public <T> T readValue(JsonParser p, TypeReference<T> valueTypeRef) {
3333
return null;
3434
}
3535
@Override
@@ -42,7 +42,7 @@ public <T> Iterator<T> readValues(JsonParser p, Class<T> valueType) {
4242
}
4343
@Override
4444
public <T> Iterator<T> readValues(JsonParser p,
45-
TypeReference<?> valueTypeRef) throws IOException {
45+
TypeReference<T> valueTypeRef) throws IOException {
4646
return null;
4747
}
4848
@Override

0 commit comments

Comments
 (0)