Removed eclipse warnings about unneeded else statements and rawtypes/unchecked access.

This commit is contained in:
Inderjeet Singh 2010-11-11 07:29:55 +00:00
parent 4d873d5dd7
commit eac1505670
4 changed files with 8 additions and 11 deletions

View File

@ -62,7 +62,7 @@ final class DefaultTypeAdapters {
private static final DefaultTimestampDeserializer TIMESTAMP_DESERIALIZER = private static final DefaultTimestampDeserializer TIMESTAMP_DESERIALIZER =
new DefaultTimestampDeserializer(); new DefaultTimestampDeserializer();
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
private static final EnumTypeAdapter ENUM_TYPE_ADAPTER = new EnumTypeAdapter(); private static final EnumTypeAdapter ENUM_TYPE_ADAPTER = new EnumTypeAdapter();
private static final UrlTypeAdapter URL_TYPE_ADAPTER = new UrlTypeAdapter(); private static final UrlTypeAdapter URL_TYPE_ADAPTER = new UrlTypeAdapter();
private static final UriTypeAdapter URI_TYPE_ADAPTER = new UriTypeAdapter(); private static final UriTypeAdapter URI_TYPE_ADAPTER = new UriTypeAdapter();
@ -196,7 +196,7 @@ final class DefaultTypeAdapters {
return map; return map;
} }
@SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "rawtypes"})
private static JsonDeserializer<?> wrapDeserializer(JsonDeserializer<?> deserializer) { private static JsonDeserializer<?> wrapDeserializer(JsonDeserializer<?> deserializer) {
return new JsonDeserializerExceptionWrapper(deserializer); return new JsonDeserializerExceptionWrapper(deserializer);
} }
@ -507,7 +507,7 @@ final class DefaultTypeAdapters {
} }
} }
@SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "rawtypes"})
private static class CollectionTypeAdapter implements JsonSerializer<Collection>, private static class CollectionTypeAdapter implements JsonSerializer<Collection>,
JsonDeserializer<Collection>, InstanceCreator<Collection> { JsonDeserializer<Collection>, InstanceCreator<Collection> {
public JsonElement serialize(Collection src, Type typeOfSrc, JsonSerializationContext context) { public JsonElement serialize(Collection src, Type typeOfSrc, JsonSerializationContext context) {
@ -570,7 +570,7 @@ final class DefaultTypeAdapters {
} }
} }
@SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "rawtypes"})
static class MapTypeAdapter implements JsonSerializer<Map>, JsonDeserializer<Map>, static class MapTypeAdapter implements JsonSerializer<Map>, JsonDeserializer<Map>,
InstanceCreator<Map> { InstanceCreator<Map> {

View File

@ -171,7 +171,7 @@ final class JsonSerializationVisitor implements ObjectNavigator.Visitor {
/** /**
* objTypePair.getObject() must not be null * objTypePair.getObject() must not be null
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "rawtypes"})
private JsonElement findAndInvokeCustomSerializer(ObjectTypePair objTypePair) { private JsonElement findAndInvokeCustomSerializer(ObjectTypePair objTypePair) {
Pair<JsonSerializer<?>,ObjectTypePair> pair = objTypePair.getMatchingHandler(serializers); Pair<JsonSerializer<?>,ObjectTypePair> pair = objTypePair.getMatchingHandler(serializers);
if (pair == null) { if (pair == null) {

View File

@ -45,9 +45,8 @@ final class Streams {
*/ */
if (isEmpty) { if (isEmpty) {
return JsonNull.createJsonNull(); return JsonNull.createJsonNull();
} else {
throw new JsonIOException(e);
} }
throw new JsonIOException(e);
} catch (MalformedJsonException e) { } catch (MalformedJsonException e) {
throw new JsonSyntaxException(e); throw new JsonSyntaxException(e);
} catch (IOException e) { } catch (IOException e) {

View File

@ -70,11 +70,9 @@ public class TypeVariableTest extends TestCase {
public boolean equals(Object o) { public boolean equals(Object o) {
if (!(o instanceof Blue)) { if (!(o instanceof Blue)) {
return false; return false;
} else {
Blue blue = (Blue) o;
return redField.equals(blue.redField);
} }
Blue blue = (Blue) o;
return redField.equals(blue.redField);
} }
} }