diff --git a/kubernetes/src/main/java/io/kubernetes/client/JSON.java b/kubernetes/src/main/java/io/kubernetes/client/JSON.java index 63d02ff7e9..99d8287a93 100644 --- a/kubernetes/src/main/java/io/kubernetes/client/JSON.java +++ b/kubernetes/src/main/java/io/kubernetes/client/JSON.java @@ -3,7 +3,7 @@ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: v1.6.9 - * + * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git @@ -16,7 +16,6 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapter; -import com.google.gson.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; @@ -33,7 +32,6 @@ import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; -import java.text.ParsePosition; import java.util.Date; public class JSON { @@ -290,7 +288,7 @@ public java.sql.Date read(JsonReader in) throws IOException { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + return new java.sql.Date(ISODateTimeFormat.basicDateTime().parseMillis(date)); } catch (ParseException e) { throw new JsonParseException(e); } @@ -326,7 +324,7 @@ public void write(JsonWriter out, Date date) throws IOException { if (dateFormat != null) { value = dateFormat.format(date); } else { - value = ISO8601Utils.format(date, true); + value = ISODateTimeFormat.basicDateTime().print(date.getTime()); } out.value(value); } @@ -345,7 +343,7 @@ public Date read(JsonReader in) throws IOException { if (dateFormat != null) { return dateFormat.parse(date); } - return ISO8601Utils.parse(date, new ParsePosition(0)); + return ISODateTimeFormat.basicDateTime().parseDateTime(date).toDate(); } catch (ParseException e) { throw new JsonParseException(e); }