removed deprecation warnings by using JsonNull.INSTANCE
This commit is contained in:
parent
5d31558428
commit
f2eb76eac9
@ -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));
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user