3
3
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4
4
*
5
5
* OpenAPI spec version: v1.6.9
6
- *
6
+ *
7
7
*
8
8
* NOTE: This class is auto generated by the swagger code generator program.
9
9
* https://github.com/swagger-api/swagger-codegen.git
16
16
import com .google .gson .GsonBuilder ;
17
17
import com .google .gson .JsonParseException ;
18
18
import com .google .gson .TypeAdapter ;
19
- import com .google .gson .internal .bind .util .ISO8601Utils ;
20
19
import com .google .gson .stream .JsonReader ;
21
20
import com .google .gson .stream .JsonWriter ;
22
21
33
32
import java .lang .reflect .Type ;
34
33
import java .text .DateFormat ;
35
34
import java .text .ParseException ;
36
- import java .text .ParsePosition ;
37
35
import java .util .Date ;
38
36
39
37
public class JSON {
@@ -290,7 +288,7 @@ public java.sql.Date read(JsonReader in) throws IOException {
290
288
if (dateFormat != null ) {
291
289
return new java .sql .Date (dateFormat .parse (date ).getTime ());
292
290
}
293
- return new java .sql .Date (ISO8601Utils . parse ( date , new ParsePosition ( 0 )). getTime ( ));
291
+ return new java .sql .Date (ISODateTimeFormat . basicDateTime (). parseMillis ( date ));
294
292
} catch (ParseException e ) {
295
293
throw new JsonParseException (e );
296
294
}
@@ -326,7 +324,7 @@ public void write(JsonWriter out, Date date) throws IOException {
326
324
if (dateFormat != null ) {
327
325
value = dateFormat .format (date );
328
326
} else {
329
- value = ISO8601Utils . format ( date , true );
327
+ value = ISODateTimeFormat . basicDateTime (). print ( date . getTime () );
330
328
}
331
329
out .value (value );
332
330
}
@@ -345,7 +343,7 @@ public Date read(JsonReader in) throws IOException {
345
343
if (dateFormat != null ) {
346
344
return dateFormat .parse (date );
347
345
}
348
- return ISO8601Utils . parse ( date , new ParsePosition ( 0 ) );
346
+ return ISODateTimeFormat . basicDateTime (). parseDateTime ( date ). toDate ( );
349
347
} catch (ParseException e ) {
350
348
throw new JsonParseException (e );
351
349
}
0 commit comments