replaced unchecked suppressed warnings token with more specific rawtypes

This commit is contained in:
Inderjeet Singh 2010-08-20 16:20:37 +00:00
parent bc5b836103
commit ed838ec104
3 changed files with 6 additions and 6 deletions

View File

@ -62,7 +62,7 @@ final class DefaultTypeAdapters {
private static final DefaultTimestampDeserializer TIMESTAMP_DESERIALIZER =
new DefaultTimestampDeserializer();
@SuppressWarnings("unchecked")
@SuppressWarnings({ "rawtypes" })
private static final EnumTypeAdapter ENUM_TYPE_ADAPTER = new EnumTypeAdapter();
private static final UrlTypeAdapter URL_TYPE_ADAPTER = new UrlTypeAdapter();
private static final UriTypeAdapter URI_TYPE_ADAPTER = new UriTypeAdapter();
@ -506,7 +506,7 @@ final class DefaultTypeAdapters {
}
}
@SuppressWarnings({ "unchecked" })
@SuppressWarnings({ "unchecked", "rawtypes" })
private static class CollectionTypeAdapter implements JsonSerializer<Collection>,
JsonDeserializer<Collection>, InstanceCreator<Collection> {
public JsonElement serialize(Collection src, Type typeOfSrc, JsonSerializationContext context) {

View File

@ -201,7 +201,7 @@ public class CollectionTest extends TestCase {
assertEquals("[1,2,3,4,5,6,7,8,9]", gson.toJson(target));
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "rawtypes" })
public void testRawCollectionSerialization() {
BagOfPrimitives bag1 = new BagOfPrimitives();
Collection target = Arrays.asList(bag1, bag1);
@ -223,7 +223,7 @@ public class CollectionTest extends TestCase {
} catch (JsonParseException expected) { }
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public void testRawCollectionOfBagOfPrimitivesNotAllowed() {
try {
BagOfPrimitives bag = new BagOfPrimitives(10, 20, false, "stringValue");
@ -276,7 +276,7 @@ public class CollectionTest extends TestCase {
assertTrue(deserializedCollection.contains(objB));
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "rawtypes" })
private static int[] toIntArray(Collection collection) {
int[] ints = new int[collection.size()];
int i = 0;

View File

@ -45,7 +45,7 @@ public class PrintFormattingTest extends TestCase {
gson = new Gson();
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public void testCompactFormattingLeavesNoWhiteSpace() {
List list = new ArrayList();
list.add(new BagOfPrimitives());