Skip to content

Commit 893cc37

Browse files
committed
remove char array support
1 parent cccf8a2 commit 893cc37

File tree

7 files changed

+10
-198
lines changed

7 files changed

+10
-198
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public static double parseAsDouble(final String s, final double def)
309309
/**
310310
* @param s a string representing a number to parse
311311
* @param def the default to return if `s` is not a parseable number
312-
* @param useFastParser whether to use {@link com.fasterxml.jackson.core.io.doubleparser.FastDoubleParser#parseDouble(CharSequence)}
312+
* @param useFastParser whether to use {@link com.fasterxml.jackson.core.io.doubleparser}
313313
* @return closest matching double (or `def` if there is an issue with `s`)
314314
* @since 2.14
315315
*/
@@ -339,7 +339,7 @@ public static double parseDouble(final String s) throws NumberFormatException {
339339

340340
/**
341341
* @param s a string representing a number to parse
342-
* @param useFastParser whether to use {@link com.fasterxml.jackson.core.io.doubleparser.FastDoubleParser#parseDouble(CharSequence)}
342+
* @param useFastParser whether to use {@link com.fasterxml.jackson.core.io.doubleparser}
343343
* @return closest matching double
344344
* @throws NumberFormatException if string cannot be represented by a double
345345
* @since v2.14
@@ -361,7 +361,7 @@ public static float parseFloat(final String s) throws NumberFormatException {
361361

362362
/**
363363
* @param s a string representing a number to parse
364-
* @param useFastParser whether to use {@link com.fasterxml.jackson.core.io.doubleparser.FastFloatParser#parseFloat(CharSequence)}
364+
* @param useFastParser whether to use {@link com.fasterxml.jackson.core.io.doubleparser}
365365
* @return closest matching float
366366
* @throws NumberFormatException if string cannot be represented by a float
367367
* @since v2.14

src/main/java/com/fasterxml/jackson/core/io/doubleparser/DoubleFromCharArray.java

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/main/java/com/fasterxml/jackson/core/io/doubleparser/DoubleFromCharSequence.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
*/
1212
public final class DoubleFromCharSequence extends AbstractFloatValueFromCharSequence {
1313

14+
static DoubleFromCharSequence INSTANCE = new DoubleFromCharSequence();
1415

15-
public DoubleFromCharSequence() {
16+
private DoubleFromCharSequence() {
1617

1718
}
1819

src/main/java/com/fasterxml/jackson/core/io/doubleparser/FastDoubleParser.java

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -43,35 +43,7 @@ public static double parseDouble(CharSequence str) throws NumberFormatException
4343
* @throws NumberFormatException if the string can not be parsed
4444
*/
4545
public static double parseDouble(CharSequence str, int offset, int length) throws NumberFormatException {
46-
return new DoubleFromCharSequence().parseDouble(str, offset, length);
47-
}
48-
49-
/**
50-
* Convenience method for calling {@link #parseDouble(char[], int, int)}.
51-
*
52-
* @param str the string to be parsed
53-
* @return the parsed double value
54-
* @throws NumberFormatException if the string can not be parsed
55-
*/
56-
public static double parseDouble(char[] str) throws NumberFormatException {
57-
return parseDouble(str, 0, str.length);
58-
}
59-
60-
/**
61-
* Parses a {@code FloatValue} from a {@code byte}-Array and converts it
62-
* into a {@code double} value.
63-
* <p>
64-
* See {@link com.fasterxml.jackson.core.io.doubleparser} for the syntax of {@code FloatValue}.
65-
*
66-
* @param str the string to be parsed, a byte array with characters
67-
* in ISO-8859-1, ASCII or UTF-8 encoding
68-
* @param off The index of the first character to parse
69-
* @param len The number of characters to parse
70-
* @return the parsed double value
71-
* @throws NumberFormatException if the string can not be parsed
72-
*/
73-
public static double parseDouble(char[] str, int off, int len) throws NumberFormatException {
74-
return new DoubleFromCharArray().parseDouble(str, off, len);
46+
return DoubleFromCharSequence.INSTANCE.parseDouble(str, offset, length);
7547
}
7648

7749
}

src/main/java/com/fasterxml/jackson/core/io/doubleparser/FastFloatParser.java

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -43,35 +43,7 @@ public static float parseFloat(CharSequence str) throws NumberFormatException {
4343
* @throws NumberFormatException if the string can not be parsed
4444
*/
4545
public static float parseFloat(CharSequence str, int offset, int length) throws NumberFormatException {
46-
return new FloatFromCharSequence().parseFloat(str, offset, length);
47-
}
48-
49-
/**
50-
* Convenience method for calling {@link #parseFloat(char[], int, int)}.
51-
*
52-
* @param str the string to be parsed
53-
* @return the parsed float value
54-
* @throws NumberFormatException if the string can not be parsed
55-
*/
56-
public static float parseFloat(char[] str) throws NumberFormatException {
57-
return parseFloat(str, 0, str.length);
58-
}
59-
60-
/**
61-
* Parses a {@code FloatValue} from a {@code byte}-Array and converts it
62-
* into a {@code float} value.
63-
* <p>
64-
* See {@link com.fasterxml.jackson.core.io.doubleparser} for the syntax of {@code FloatValue}.
65-
*
66-
* @param str the string to be parsed, a byte array with characters
67-
* in ISO-8859-1, ASCII or UTF-8 encoding
68-
* @param off The index of the first character to parse
69-
* @param len The number of characters to parse
70-
* @return the parsed float value
71-
* @throws NumberFormatException if the string can not be parsed
72-
*/
73-
public static float parseFloat(char[] str, int off, int len) throws NumberFormatException {
74-
return new FloatFromCharArray().parseFloat(str, off, len);
46+
return FloatFromCharSequence.INSTANCE.parseFloat(str, offset, length);
7547
}
7648

7749
}

src/main/java/com/fasterxml/jackson/core/io/doubleparser/FloatFromCharArray.java

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/main/java/com/fasterxml/jackson/core/io/doubleparser/FloatFromCharSequence.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
/**
1010
* Parses a {@code float} from a {@link CharSequence}.
1111
*/
12-
public class FloatFromCharSequence extends AbstractFloatValueFromCharSequence {
12+
final class FloatFromCharSequence extends AbstractFloatValueFromCharSequence {
1313

14+
final static FloatFromCharSequence INSTANCE = new FloatFromCharSequence();
1415

15-
public FloatFromCharSequence() {
16+
private FloatFromCharSequence() {
1617

1718
}
1819

0 commit comments

Comments
 (0)