Fixed warnings and updated some JavaDoc.
This commit is contained in:
parent
50dd475eb8
commit
b9e81f93c1
|
@ -28,7 +28,7 @@ public final class JsonNull extends JsonElement {
|
||||||
private static final JsonNull INSTANCE = new JsonNull(true);
|
private static final JsonNull INSTANCE = new JsonNull(true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated use the creation method, {@link #createJsonNull()}, instead.
|
* @deprecated Instead, use the creation method, {@link #createJsonNull()}.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public JsonNull() {
|
public JsonNull() {
|
||||||
|
@ -60,6 +60,13 @@ public final class JsonNull extends JsonElement {
|
||||||
return other instanceof JsonNull;
|
return other instanceof JsonNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creation method used to return an instance of a {@link JsonNull}. To reduce the memory
|
||||||
|
* footprint, a single object has been created for this class; therefore the same instance is
|
||||||
|
* being returned for each invocation of this method.
|
||||||
|
*
|
||||||
|
* @return a instance of a {@link JsonNull}
|
||||||
|
*/
|
||||||
public static JsonNull createJsonNull() {
|
public static JsonNull createJsonNull() {
|
||||||
return INSTANCE;
|
return INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,7 @@ public class NullObjectAndFieldTest extends TestCase {
|
||||||
public JsonElement serialize(ClassWithObjects src, Type typeOfSrc,
|
public JsonElement serialize(ClassWithObjects src, Type typeOfSrc,
|
||||||
JsonSerializationContext context) {
|
JsonSerializationContext context) {
|
||||||
JsonObject obj = new JsonObject();
|
JsonObject obj = new JsonObject();
|
||||||
obj.add("bag", new JsonNull());
|
obj.add("bag", JsonNull.createJsonNull());
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user