In the follow code the print(...) method throws NPE when try to get the type of the tree.
ResourceRepresentation<Void> empty = ResourceRepresentation.empty();
JsonRepresentationWriter writer = JsonRepresentationWriter.create();
ByteString jsonBS = writer.print(empty);
System.out.println(jsonBS.utf8());
The empty resource should be printed into {} string. This would be empty JSON document.
On another hand because empty JSON is not valid HAL document I guess factory call ResourceRepresentation.empty() should not be allowed.
The same problem exists even of I provide href for self link. So any call to empty(...) produces invalid ResourceRepresentation instance.
In the follow code the
print(...)method throws NPE when try to get the type of the tree.The empty resource should be printed into
{}string. This would be empty JSON document.On another hand because empty JSON is not valid HAL document I guess factory call
ResourceRepresentation.empty()should not be allowed.The same problem exists even of I provide href for self link. So any call to empty(...) produces invalid ResourceRepresentation instance.