From acdb0c8a5b8df65cdb1dea5ea94f4e81c5d1087b Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Wed, 12 Sep 2012 12:51:28 +0200 Subject: [PATCH] #11 - Revert to List for links in ResourceSupport. The order of the links needs to be stable across different requests. Thus we have to revert to List instead of a Set. --- .../org/springframework/hateoas/ResourceSupport.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/springframework/hateoas/ResourceSupport.java b/src/main/java/org/springframework/hateoas/ResourceSupport.java index 1ce6249f..3641078d 100755 --- a/src/main/java/org/springframework/hateoas/ResourceSupport.java +++ b/src/main/java/org/springframework/hateoas/ResourceSupport.java @@ -15,9 +15,9 @@ */ package org.springframework.hateoas; +import java.util.ArrayList; import java.util.Collections; -import java.util.HashSet; -import java.util.Set; +import java.util.List; import javax.xml.bind.annotation.XmlElement; @@ -34,10 +34,10 @@ public class ResourceSupport implements Identifiable { @XmlElement(name = "link", namespace = Link.ATOM_NAMESPACE) @JsonProperty("links") - private final Set links; + private final List links; public ResourceSupport() { - this.links = new HashSet(); + this.links = new ArrayList(); } /** @@ -94,8 +94,8 @@ public class ResourceSupport implements Identifiable { * * @return */ - public Set getLinks() { - return Collections.unmodifiableSet(links); + public List getLinks() { + return Collections.unmodifiableList(links); } /**