#813 - address PR review comment - brought down visibility.

This commit is contained in:
rudrajyoti biswas 2023-10-23 23:03:35 +05:30
parent 98b79ae7bf
commit 5539722c69
2 changed files with 4 additions and 5 deletions

View File

@ -3,7 +3,7 @@ package org.json;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
public class NumberConversionUtil { class NumberConversionUtil {
/** /**
* Converts a string to a number using the narrowest possible type. Possible * Converts a string to a number using the narrowest possible type. Possible
@ -15,7 +15,7 @@ public class NumberConversionUtil {
* @throws NumberFormatException thrown if the value is not a valid number. A public * @throws NumberFormatException thrown if the value is not a valid number. A public
* caller should catch this and wrap it in a {@link JSONException} if applicable. * caller should catch this and wrap it in a {@link JSONException} if applicable.
*/ */
public static Number stringToNumber(final String input) throws NumberFormatException { static Number stringToNumber(final String input) throws NumberFormatException {
String val = input; String val = input;
if (val.startsWith(".")){ if (val.startsWith(".")){
val = "0"+val; val = "0"+val;
@ -88,7 +88,7 @@ public class NumberConversionUtil {
* @param value * @param value
* @return * @return
*/ */
public static boolean potentialNumber(String value){ static boolean potentialNumber(String value){
if (value == null || value.isEmpty()){ if (value == null || value.isEmpty()){
return false; return false;
} }

View File

@ -1,6 +1,5 @@
package org.json.junit; package org.json;
import org.json.NumberConversionUtil;
import org.junit.Test; import org.junit.Test;
import java.math.BigDecimal; import java.math.BigDecimal;