This repository was archived by the owner on Dec 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/java/synapticloop/b2/response Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,13 +100,13 @@ protected String readString(JSONObject response, String key) {
100100 *
101101 * @param key the key to read as an int and remove
102102 *
103- * @return the read key (or -1 if it doesn't exist)
103+ * @return the read key (or null if it doesn't exist)
104104 */
105- protected int readInt (String key ) {
105+ protected Integer readInt (String key ) {
106106 final Object value = response .remove (key );
107107 if (null == value || JSONObject .NULL == value ) {
108108 getLogger ().warn ("No field for key {}" , key );
109- return - 1 ;
109+ return null ;
110110 }
111111 return value instanceof Number ? ((Number ) value ).intValue () : Integer .parseInt (value .toString ());
112112 }
@@ -116,13 +116,13 @@ protected int readInt(String key) {
116116 *
117117 * @param key the key to read as a long and remove
118118 *
119- * @return the read key (or -1L if it doesn't exist)
119+ * @return the read key (or null if it doesn't exist)
120120 */
121- protected long readLong (String key ) {
121+ protected Long readLong (String key ) {
122122 final Object value = response .remove (key );
123123 if (null == value || JSONObject .NULL == value ) {
124124 getLogger ().warn ("No field for key {}" , key );
125- return - 1L ;
125+ return null ;
126126 }
127127 return value instanceof Number ? ((Number ) value ).longValue () : Long .parseLong (value .toString ());
128128 }
You can’t perform that action at this time.
0 commit comments