Skip to content

Commit f1819ee

Browse files
authored
Merge pull request #366 from netdava/remove-gson-internal-api
Dropped reference to gson internal API
2 parents 7cf9a99 + 39f0f15 commit f1819ee

File tree

1 file changed

+4
-6
lines changed
  • kubernetes/src/main/java/io/kubernetes/client

1 file changed

+4
-6
lines changed

kubernetes/src/main/java/io/kubernetes/client/JSON.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
44
*
55
* OpenAPI spec version: v1.6.9
6-
*
6+
*
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
99
* https://github.com/swagger-api/swagger-codegen.git
@@ -16,7 +16,6 @@
1616
import com.google.gson.GsonBuilder;
1717
import com.google.gson.JsonParseException;
1818
import com.google.gson.TypeAdapter;
19-
import com.google.gson.internal.bind.util.ISO8601Utils;
2019
import com.google.gson.stream.JsonReader;
2120
import com.google.gson.stream.JsonWriter;
2221

@@ -33,7 +32,6 @@
3332
import java.lang.reflect.Type;
3433
import java.text.DateFormat;
3534
import java.text.ParseException;
36-
import java.text.ParsePosition;
3735
import java.util.Date;
3836

3937
public class JSON {
@@ -290,7 +288,7 @@ public java.sql.Date read(JsonReader in) throws IOException {
290288
if (dateFormat != null) {
291289
return new java.sql.Date(dateFormat.parse(date).getTime());
292290
}
293-
return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime());
291+
return new java.sql.Date(ISODateTimeFormat.basicDateTime().parseMillis(date));
294292
} catch (ParseException e) {
295293
throw new JsonParseException(e);
296294
}
@@ -326,7 +324,7 @@ public void write(JsonWriter out, Date date) throws IOException {
326324
if (dateFormat != null) {
327325
value = dateFormat.format(date);
328326
} else {
329-
value = ISO8601Utils.format(date, true);
327+
value = ISODateTimeFormat.basicDateTime().print(date.getTime());
330328
}
331329
out.value(value);
332330
}
@@ -345,7 +343,7 @@ public Date read(JsonReader in) throws IOException {
345343
if (dateFormat != null) {
346344
return dateFormat.parse(date);
347345
}
348-
return ISO8601Utils.parse(date, new ParsePosition(0));
346+
return ISODateTimeFormat.basicDateTime().parseDateTime(date).toDate();
349347
} catch (ParseException e) {
350348
throw new JsonParseException(e);
351349
}

0 commit comments

Comments
 (0)