Simplified access of getSimpleName (#1042)
* Simplified access of getSimpleName instead of calling getClass.getSimpleName() that will check too many conditions inside , we can make it as final String and use it directly. * Simplified access of getSimpleName making string as static * Simplified access of getSimpleName Code Review changes
This commit is contained in:
parent
3063136a2c
commit
441fa98735
|
@ -37,10 +37,12 @@ import com.google.gson.internal.bind.util.ISO8601Utils;
|
||||||
final class DefaultDateTypeAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> {
|
final class DefaultDateTypeAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> {
|
||||||
|
|
||||||
// TODO: migrate to streaming adapter
|
// TODO: migrate to streaming adapter
|
||||||
|
|
||||||
|
private static final String SIMPLE_NAME = "DefaultDateTypeAdapter";
|
||||||
|
|
||||||
private final DateFormat enUsFormat;
|
private final DateFormat enUsFormat;
|
||||||
private final DateFormat localFormat;
|
private final DateFormat localFormat;
|
||||||
|
|
||||||
DefaultDateTypeAdapter() {
|
DefaultDateTypeAdapter() {
|
||||||
this(DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.US),
|
this(DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.US),
|
||||||
DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT));
|
DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT));
|
||||||
|
@ -111,7 +113,7 @@ final class DefaultDateTypeAdapter implements JsonSerializer<Date>, JsonDeserial
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(DefaultDateTypeAdapter.class.getSimpleName());
|
sb.append(SIMPLE_NAME);
|
||||||
sb.append('(').append(localFormat.getClass().getSimpleName()).append(')');
|
sb.append('(').append(localFormat.getClass().getSimpleName()).append(')');
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue