Explicit JsonSyntaxException
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
80c91b6409
commit
780e6a7283
|
@ -14,6 +14,7 @@ public class Cl {
|
|||
public static final ClassName TYPE_TOKEN = ClassName.get("io.gitlab.jfronny.gson.reflect", "TypeToken");
|
||||
public static final ClassName GSON_TOKEN = ClassName.get("io.gitlab.jfronny.gson.stream", "JsonToken");
|
||||
public static final ClassName SERIALIZED_NAME = ClassName.get("io.gitlab.jfronny.gson.annotations", "SerializedName");
|
||||
public static final ClassName GSON_SYNTAX_EXCEPTION = ClassName.get("io.gitlab.jfronny.gson", "JsonSyntaxException");
|
||||
|
||||
public static final ClassName GCOMMENT = ClassName.get("io.gitlab.jfronny.gson.compile.annotations", "GComment");
|
||||
public static final ClassName GISO8601UTILS = ClassName.get("io.gitlab.jfronny.gson.internal.bind.util", "ISO8601Utils");
|
||||
|
|
|
@ -44,7 +44,7 @@ public class DateAdapter extends Adapter<DateAdapter.Hydrated> {
|
|||
kode.beginControlFlow("try")
|
||||
.addStatement("return $T.parse(date, new $T(0))", Cl.GISO8601UTILS, ParsePosition.class)
|
||||
.nextControlFlow("catch ($T e)", ParseException.class)
|
||||
.addStatement("throw new JsonSyntaxException(\"Failed Parsing '\" + date + \"' as Date\", e)")
|
||||
.addStatement("throw new $T(\"Failed Parsing '\" + date + \"' as Date\", e)", Cl.GSON_SYNTAX_EXCEPTION)
|
||||
.endControlFlow();
|
||||
klazz.addMethod(
|
||||
MethodSpec.methodBuilder("parseDate")
|
||||
|
|
Loading…
Reference in New Issue