Skip to content

Commit

Permalink
Dropped reference to gson internal API
Browse files Browse the repository at this point in the history
* JSON class is ignored by swagger code gen
* please document process around swagger code-gen so people can contribute
* please separate generated code from developed code
  • Loading branch information
Ioan Eugen Stan committed Sep 12, 2018
1 parent 4918869 commit 39f0f15
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions kubernetes/src/main/java/io/kubernetes/client/JSON.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

Expand All @@ -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 {
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 39f0f15

Please sign in to comment.