* make sure we create unique objects for JSON serialization

This commit is contained in:
Reinhard Pointner 2014-08-23 14:34:26 +00:00
parent 7ae3fa8183
commit 762f9015af
4 changed files with 11 additions and 7 deletions

View File

@ -14,7 +14,7 @@ public class HyperLink extends SearchResult {
} }
public HyperLink(String name, URL url) { public HyperLink(String name, URL url) {
super(name); super(name, new String[0]);
this.url = url; this.url = url;
} }

View File

@ -8,11 +8,15 @@ import java.util.List;
public class MultiEpisode extends Episode { public class MultiEpisode extends Episode {
private Episode[] episodes; protected Episode[] episodes;
protected MultiEpisode() {
// used by serializer
}
public MultiEpisode(Episode... episodes) { public MultiEpisode(Episode... episodes) {
super(episodes[0]); super(episodes[0]);
this.episodes = episodes; this.episodes = episodes.clone();
} }
public List<Episode> getEpisodes() { public List<Episode> getEpisodes() {
@ -35,7 +39,7 @@ public class MultiEpisode extends Episode {
@Override @Override
public MultiEpisode clone() { public MultiEpisode clone() {
return new MultiEpisode(episodes.clone()); return new MultiEpisode(episodes);
} }
@Override @Override

View File

@ -14,9 +14,9 @@ public abstract class SearchResult implements Serializable {
// used by serializer // used by serializer
} }
public SearchResult(String name, String... aliasNames) { public SearchResult(String name, String[] aliasNames) {
this.name = name; this.name = name;
this.aliasNames = aliasNames; this.aliasNames = aliasNames.clone();
} }
public String getName() { public String getName() {

View File

@ -10,7 +10,7 @@ public class TVRageSearchResult extends SearchResult {
} }
public TVRageSearchResult(String name, int showId, String link) { public TVRageSearchResult(String name, int showId, String link) {
super(name); super(name, new String[0]);
this.showId = showId; this.showId = showId;
this.link = link; this.link = link;
} }