Skip to content

Commit 3288503

Browse files
committed
Merge branch '2.15' into 2.16
2 parents 03013f2 + b05b2e7 commit 3288503

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

src/main/java/com/fasterxml/jackson/core/base/GeneratorBase.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package com.fasterxml.jackson.core.base;
22

3+
import java.io.IOException;
4+
import java.io.InputStream;
5+
import java.math.BigDecimal;
6+
37
import com.fasterxml.jackson.core.*;
48
import com.fasterxml.jackson.core.io.IOContext;
59
import com.fasterxml.jackson.core.json.DupDetector;
610
import com.fasterxml.jackson.core.json.JsonWriteContext;
711
import com.fasterxml.jackson.core.json.PackageVersion;
812
import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
913

10-
import java.io.IOException;
11-
import java.io.InputStream;
12-
import java.math.BigDecimal;
13-
1414
/**
1515
* This base class implements part of API that a JSON generator exposes
1616
* to applications, adds shared internal methods that sub-classes

src/main/java/com/fasterxml/jackson/core/io/BigDecimalParser.java

+30-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@
1212
// https://github.com/eobermuhlner/big-math/commit/7a5419aac8b2adba2aa700ccf00197f97b2ad89f
1313

1414
/**
15-
* Helper class used to implement more optimized parsing of {@link BigDecimal} for REALLY
16-
* big values (over 500 characters)
15+
* Internal Jackson Helper class used to implement more optimized parsing of {@link BigDecimal} for REALLY
16+
* big values (over 500 characters).
17+
*<p>
18+
* This class is not meant to be used directly. It is designed to be used by Jackson JSON parsers (and parsers
19+
* for other Jackson supported data formats). The parsers check for invalid characters and the length of the number.
20+
* Without these checks, this parser is susceptible to performing badly with invalid inputs. If you need to parse
21+
* numbers directly, please use JavaBigDecimalParser in <a href="https://github.com/wrandelshofer/FastDoubleParser">fastdoubleparser</a>
22+
* instead.
23+
*</p>
1724
*<p>
1825
* Based on ideas from this
1926
* <a href="https://github.com/eobermuhlner/big-math/commit/7a5419aac8b2adba2aa700ccf00197f97b2ad89f">this
2027
* git commit</a>.
28+
*</p>
2129
*
2230
* @since 2.13
2331
*/
@@ -27,10 +35,23 @@ public final class BigDecimalParser
2735

2836
private BigDecimalParser() {}
2937

38+
/**
39+
* Internal Jackson method. Please do not use.
40+
*
41+
* @param valueStr
42+
* @return BigDecimal value
43+
* @throws NumberFormatException
44+
*/
3045
public static BigDecimal parse(String valueStr) {
3146
return parse(valueStr.toCharArray());
3247
}
3348

49+
/**
50+
* Internal Jackson method. Please do not use.
51+
*
52+
* @return BigDecimal value
53+
* @throws NumberFormatException
54+
*/
3455
public static BigDecimal parse(final char[] chars, final int off, final int len) {
3556
try {
3657
if (len < 500) {
@@ -58,6 +79,13 @@ public static BigDecimal parse(final char[] chars, final int off, final int len)
5879
}
5980
}
6081

82+
/**
83+
* Internal Jackson method. Please do not use.
84+
*
85+
* @param chars
86+
* @return BigDecimal value
87+
* @throws NumberFormatException
88+
*/
6189
public static BigDecimal parse(char[] chars) {
6290
return parse(chars, 0, chars.length);
6391
}

0 commit comments

Comments
 (0)