fix ResourceType to always have an empty collection

This commit is contained in:
danikov 2012-03-16 16:51:13 +00:00
parent 22b72ad25f
commit 9f94c96f7f

View File

@ -130,14 +130,15 @@ public class ResourceType {
protected ResourceType(Builder<?> builder) {
this.href = builder.href;
this.type = builder.type;
this.links = builder.links;
this.links = builder.links == null ? Collections.<Link>emptySet() : builder.links;
}
@Deprecated
public ResourceType(URI href, String type, @Nullable Set<Link> links) {
this.href = href;
this.type = type;
// nullable so that jaxb wont persist empty collections?
this.links = links != null && links.isEmpty() ? null : links;
this.links = links == null ? Collections.<Link>emptySet() : links;
}
protected ResourceType() {