mirror of
https://github.com/stleary/JSON-java.git
synced 2025-10-01 14:25:55 -04:00
sonar cube stuff
This commit is contained in:
parent
78137d389d
commit
9bb26bdb34
@ -480,6 +480,7 @@ public class JSONObject {
|
|||||||
try {
|
try {
|
||||||
this.putOpt(name, c.getField(name).get(object));
|
this.putOpt(name, c.getField(name).get(object));
|
||||||
} catch (Exception ignore) {
|
} catch (Exception ignore) {
|
||||||
|
// if invalid, do not include key:value pair in JSONObject
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -651,9 +652,9 @@ public class JSONObject {
|
|||||||
return "null";
|
return "null";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shave off trailing zeros and decimal point, if possible.
|
// Shave off trailing zeros and decimal point, if possible.
|
||||||
|
|
||||||
String string = Double.toString(d);
|
String string = Double.toString(d);
|
||||||
|
// idx = 0 case is covered by behavior of Double.toString()
|
||||||
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
|
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
|
||||||
&& string.indexOf('E') < 0) {
|
&& string.indexOf('E') < 0) {
|
||||||
while (string.endsWith("0")) {
|
while (string.endsWith("0")) {
|
||||||
@ -1130,8 +1131,8 @@ public class JSONObject {
|
|||||||
testValidity(number);
|
testValidity(number);
|
||||||
|
|
||||||
// Shave off trailing zeros and decimal point, if possible.
|
// Shave off trailing zeros and decimal point, if possible.
|
||||||
|
|
||||||
String string = number.toString();
|
String string = number.toString();
|
||||||
|
// idx = 0 case is covered by behavior of .toString()
|
||||||
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
|
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
|
||||||
&& string.indexOf('E') < 0) {
|
&& string.indexOf('E') < 0) {
|
||||||
while (string.endsWith("0")) {
|
while (string.endsWith("0")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user