Skip to content

Commit 1994217

Browse files
committed
Add explicit override for JSON parsers for JsonParser.getNumberTypeFP()
1 parent f788391 commit 1994217

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/main/java/com/fasterxml/jackson/core/json/JsonParserBase.java

+22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package com.fasterxml.jackson.core.json;
22

3+
import java.io.IOException;
4+
35
import com.fasterxml.jackson.core.*;
6+
import com.fasterxml.jackson.core.JsonParser.NumberTypeFP;
47
import com.fasterxml.jackson.core.base.ParserBase;
58
import com.fasterxml.jackson.core.io.CharTypes;
69
import com.fasterxml.jackson.core.io.IOContext;
@@ -80,6 +83,25 @@ public final JacksonFeatureSet<StreamReadCapability> getReadCapabilities() {
8083
return JSON_READ_CAPABILITIES;
8184
}
8285

86+
/*
87+
/**********************************************************************
88+
/* Overrides
89+
/**********************************************************************
90+
*/
91+
92+
/**
93+
* JSON format does not have native information on "correct" floating-point
94+
* type to use, unlike some formats (most binary formats), so it needs to
95+
* indicate this as {@link NumberTypeFP#UNKNOWN}.
96+
*
97+
* @return Natural floating-point type if known; {@link NumberTypeFP#UNKNOWN} for
98+
* all JSON-backed parsers.
99+
*/
100+
@Override // added in 2.17
101+
public NumberTypeFP getNumberTypeFP() throws IOException {
102+
return NumberTypeFP.UNKNOWN;
103+
}
104+
83105
/*
84106
/**********************************************************************
85107
/* Location handling

0 commit comments

Comments
 (0)