File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
src/main/java/com/mastercard/developer/json Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ private static boolean isClassFound(String className) {
5656 }
5757 }
5858
59- protected Object asPrimitiveValue (String string ) {
59+ protected static Object asPrimitiveValue (String string ) {
6060 // Boolean?
6161 if ("true" .equals (string ) || "false" .equals (string )) {
6262 return Boolean .valueOf (string );
@@ -66,14 +66,13 @@ protected Object asPrimitiveValue(String string) {
6666 try {
6767 return Long .valueOf (string );
6868 } catch (NumberFormatException e ) {
69- // Do nothing
69+ // Not a number, do nothing
7070 }
7171
7272 // String
7373 return string ;
7474 }
7575
76-
7776 public String toJsonString (Object object ) {
7877 if (null == object ) {
7978 throw new IllegalStateException ("Can get a JSON string from a null object!" );
@@ -84,7 +83,6 @@ public String toJsonString(Object object) {
8483 return getJsonProvider ().toJson (object );
8584 }
8685
87-
8886 protected boolean isJsonPrimitive (Object jsonElement ) {
8987 JsonProvider jsonProvider = getJsonProvider ();
9088 return !jsonProvider .isMap (jsonElement ) && !jsonProvider .isArray (jsonElement );
You can’t perform that action at this time.
0 commit comments