Skip to content

Commit

Permalink
Add explicit override for JSON parsers for `JsonParser.getNumberTypeF…
Browse files Browse the repository at this point in the history
…P()`
  • Loading branch information
cowtowncoder committed Mar 4, 2024
1 parent f788391 commit 1994217
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/java/com/fasterxml/jackson/core/json/JsonParserBase.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.fasterxml.jackson.core.json;

import java.io.IOException;

import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.core.JsonParser.NumberTypeFP;
import com.fasterxml.jackson.core.base.ParserBase;
import com.fasterxml.jackson.core.io.CharTypes;
import com.fasterxml.jackson.core.io.IOContext;
Expand Down Expand Up @@ -80,6 +83,25 @@ public final JacksonFeatureSet<StreamReadCapability> getReadCapabilities() {
return JSON_READ_CAPABILITIES;
}

/*
/**********************************************************************
/* Overrides
/**********************************************************************
*/

/**
* JSON format does not have native information on "correct" floating-point
* type to use, unlike some formats (most binary formats), so it needs to
* indicate this as {@link NumberTypeFP#UNKNOWN}.
*
* @return Natural floating-point type if known; {@link NumberTypeFP#UNKNOWN} for
* all JSON-backed parsers.
*/
@Override // added in 2.17
public NumberTypeFP getNumberTypeFP() throws IOException {
return NumberTypeFP.UNKNOWN;
}

/*
/**********************************************************************
/* Location handling
Expand Down

0 comments on commit 1994217

Please sign in to comment.