removed deprecation warnings by using JsonNull.INSTANCE

This commit is contained in:
Inderjeet Singh 2011-05-25 16:48:39 +00:00
parent 5d31558428
commit f2eb76eac9
4 changed files with 5 additions and 3 deletions

View File

@ -45,7 +45,7 @@ public final class JsonArrayTest extends TestCase {
assertFalse(a.equals(b));
assertFalse(b.equals(a));
b.add(new JsonNull());
b.add(JsonNull.INSTANCE);
assertFalse(a.equals(b));
assertFalse(b.equals(a));
}

View File

@ -24,8 +24,10 @@ import junit.framework.TestCase;
*/
public final class JsonNullTest extends TestCase {
@SuppressWarnings("deprecation")
public void testEqualsAndHashcode() {
MoreAsserts.assertEqualsAndHashCode(new JsonNull(), new JsonNull());
MoreAsserts.assertEqualsAndHashCode(new JsonNull(), JsonNull.INSTANCE);
MoreAsserts.assertEqualsAndHashCode(new JsonNull(), JsonNull.createJsonNull());
MoreAsserts.assertEqualsAndHashCode(JsonNull.createJsonNull(), JsonNull.createJsonNull());
}

View File

@ -151,7 +151,7 @@ public class JsonObjectTest extends TestCase {
assertFalse(a.equals(b));
assertFalse(b.equals(a));
b.add("bar", new JsonNull());
b.add("bar", JsonNull.INSTANCE);
assertFalse(a.equals(b));
assertFalse(b.equals(a));
}

View File

@ -164,7 +164,7 @@ public class NullObjectAndFieldTest extends TestCase {
public JsonElement serialize(ClassWithObjects src, Type typeOfSrc,
JsonSerializationContext context) {
JsonObject obj = new JsonObject();
obj.add("bag", new JsonNull());
obj.add("bag", JsonNull.INSTANCE);
return obj;
}
}