[LIB-10] SerialVersionUID for Serializable classes
authorgotty <gotty@fb0bcced-7025-49ed-a12f-f98bce993226>
Fri, 22 Nov 2019 04:33:27 +0000 (04:33 +0000)
committergotty <gotty@fb0bcced-7025-49ed-a12f-f98bce993226>
Fri, 22 Nov 2019 04:33:27 +0000 (04:33 +0000)
git-svn-id: https://svn.hedgecode.org/lib/snooker-score-api/trunk@190 fb0bcced-7025-49ed-a12f-f98bce993226

53 files changed:
src/main/java/org/hedgecode/snooker/api/Season.java
src/main/java/org/hedgecode/snooker/api/SnookerURL.java
src/main/java/org/hedgecode/snooker/compare/EventComparators.java
src/main/java/org/hedgecode/snooker/compare/MatchComparators.java
src/main/java/org/hedgecode/snooker/compare/PlayerComparators.java
src/main/java/org/hedgecode/snooker/compare/RankingComparators.java
src/main/java/org/hedgecode/snooker/compare/RoundComparators.java
src/main/java/org/hedgecode/snooker/compare/SeedingComparators.java
src/main/java/org/hedgecode/snooker/json/JsonCollectionEntity.java
src/main/java/org/hedgecode/snooker/json/JsonEvent.java
src/main/java/org/hedgecode/snooker/json/JsonEvents.java
src/main/java/org/hedgecode/snooker/json/JsonIdEntity.java
src/main/java/org/hedgecode/snooker/json/JsonMatch.java
src/main/java/org/hedgecode/snooker/json/JsonMatches.java
src/main/java/org/hedgecode/snooker/json/JsonOngoingMatch.java
src/main/java/org/hedgecode/snooker/json/JsonOngoingMatches.java
src/main/java/org/hedgecode/snooker/json/JsonPlayer.java
src/main/java/org/hedgecode/snooker/json/JsonPlayers.java
src/main/java/org/hedgecode/snooker/json/JsonRanking.java
src/main/java/org/hedgecode/snooker/json/JsonRankings.java
src/main/java/org/hedgecode/snooker/json/JsonRound.java
src/main/java/org/hedgecode/snooker/json/JsonRounds.java
src/main/java/org/hedgecode/snooker/json/JsonSeeding.java
src/main/java/org/hedgecode/snooker/json/JsonSeedings.java
src/test/java/org/hedgecode/snooker/json/AbstractJsonTest.java
src/test/java/org/hedgecode/snooker/json/JsonEventTest.java
src/test/java/org/hedgecode/snooker/json/JsonEventsTest.java
src/test/java/org/hedgecode/snooker/json/JsonMatchTest.java
src/test/java/org/hedgecode/snooker/json/JsonMatchesTest.java
src/test/java/org/hedgecode/snooker/json/JsonOngoingMatchTest.java
src/test/java/org/hedgecode/snooker/json/JsonOngoingMatchesTest.java
src/test/java/org/hedgecode/snooker/json/JsonPlayerTest.java
src/test/java/org/hedgecode/snooker/json/JsonPlayersTest.java
src/test/java/org/hedgecode/snooker/json/JsonRankingTest.java
src/test/java/org/hedgecode/snooker/json/JsonRankingsTest.java
src/test/java/org/hedgecode/snooker/json/JsonRoundTest.java
src/test/java/org/hedgecode/snooker/json/JsonRoundsTest.java
src/test/java/org/hedgecode/snooker/json/JsonSeedingTest.java
src/test/java/org/hedgecode/snooker/json/JsonSeedingsTest.java
src/test/resources/org/hedgecode/snooker/json/JsonEventTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonEventsTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonMatchTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonMatchesTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonOngoingMatchTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonOngoingMatchesTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonPlayerTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonPlayersTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonRankingTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonRankingsTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonRoundTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonRoundsTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonSeedingTest.ser
src/test/resources/org/hedgecode/snooker/json/JsonSeedingsTest.ser

index e206d8b..14c5364 100644 (file)
@@ -28,6 +28,8 @@ import java.util.Map;
  */
 public class Season implements Serializable {
 
+    private static final long serialVersionUID = -4233073149675278053L;
+
     private static final Calendar CURRENT_CALENDAR = Calendar.getInstance();
 
     private static final int NEW_SEASON_MONTH = 5; /* June */
index db14607..ceff340 100644 (file)
@@ -26,6 +26,8 @@ import java.net.URL;
  */
 public class SnookerURL implements Serializable {
 
+    private static final long serialVersionUID = 5068013909126568563L;
+
     private String name;
     private URL url;
 
index 3e2577f..63db086 100644 (file)
@@ -16,7 +16,6 @@
 
 package org.hedgecode.snooker.compare;
 
-import java.io.Serializable;
 import java.util.Comparator;
 
 import org.hedgecode.snooker.api.Event;
@@ -43,7 +42,7 @@ public enum EventComparators {
         return comparator;
     }
 
-    static class DateComparator implements Comparator<Event>, Serializable {
+    static class DateComparator implements Comparator<Event> {
 
         @Override
         public int compare(Event event1, Event event2) {
@@ -52,7 +51,7 @@ public enum EventComparators {
 
     }
 
-    static class SnookerIdComparator implements Comparator<Event>, Serializable {
+    static class SnookerIdComparator implements Comparator<Event> {
 
         @Override
         public int compare(Event event1, Event event2) {
index b7439ac..6138f84 100644 (file)
@@ -16,7 +16,6 @@
 
 package org.hedgecode.snooker.compare;
 
-import java.io.Serializable;
 import java.util.Comparator;
 
 import org.hedgecode.snooker.api.Match;
@@ -43,7 +42,7 @@ public enum MatchComparators {
         return comparator;
     }
 
-    static class RoundNumberComparator implements Comparator<Match>, Serializable {
+    static class RoundNumberComparator implements Comparator<Match> {
 
         @Override
         public int compare(Match match1, Match match2) {
@@ -54,7 +53,7 @@ public enum MatchComparators {
 
     }
 
-    static class EventComparator implements Comparator<Match>, Serializable {
+    static class EventComparator implements Comparator<Match> {
 
         @Override
         public int compare(Match match1, Match match2) {
index f389c9c..fc18aba 100644 (file)
@@ -16,7 +16,6 @@
 
 package org.hedgecode.snooker.compare;
 
-import java.io.Serializable;
 import java.util.Comparator;
 
 import org.hedgecode.snooker.api.Player;
@@ -43,7 +42,7 @@ public enum PlayerComparators {
         return comparator;
     }
 
-    static class NameComparator implements Comparator<Player>, Serializable {
+    static class NameComparator implements Comparator<Player> {
 
         @Override
         public int compare(Player player1, Player player2) {
@@ -52,7 +51,7 @@ public enum PlayerComparators {
 
     }
 
-    static class AgeComparator implements Comparator<Player>, Serializable {
+    static class AgeComparator implements Comparator<Player> {
 
         @Override
         public int compare(Player player1, Player player2) {
index 2d1bb56..3cac7a3 100644 (file)
@@ -16,7 +16,6 @@
 
 package org.hedgecode.snooker.compare;
 
-import java.io.Serializable;
 import java.util.Comparator;
 
 import org.hedgecode.snooker.api.Ranking;
@@ -43,7 +42,7 @@ public enum RankingComparators {
         return comparator;
     }
 
-    static class PositionComparator implements Comparator<Ranking>, Serializable {
+    static class PositionComparator implements Comparator<Ranking> {
 
         @Override
         public int compare(Ranking ranking1, Ranking ranking2) {
@@ -52,7 +51,7 @@ public enum RankingComparators {
 
     }
 
-    static class SumComparator implements Comparator<Ranking>, Serializable {
+    static class SumComparator implements Comparator<Ranking> {
 
         @Override
         public int compare(Ranking ranking1, Ranking ranking2) {
index 12226a9..1508ee3 100644 (file)
@@ -16,7 +16,6 @@
 
 package org.hedgecode.snooker.compare;
 
-import java.io.Serializable;
 import java.util.Comparator;
 
 import org.hedgecode.snooker.api.Round;
@@ -43,7 +42,7 @@ public enum RoundComparators {
         return comparator;
     }
 
-    static class RoundComparator implements Comparator<Round>, Serializable {
+    static class RoundComparator implements Comparator<Round> {
 
         @Override
         public int compare(Round round1, Round round2) {
@@ -52,7 +51,7 @@ public enum RoundComparators {
 
     }
 
-    static class EventComparator implements Comparator<Round>, Serializable {
+    static class EventComparator implements Comparator<Round> {
 
         @Override
         public int compare(Round round1, Round round2) {
index fa7c562..842039b 100644 (file)
@@ -16,7 +16,6 @@
 
 package org.hedgecode.snooker.compare;
 
-import java.io.Serializable;
 import java.util.Comparator;
 
 import org.hedgecode.snooker.api.Seeding;
@@ -45,7 +44,7 @@ public enum SeedingComparators {
         return comparator;
     }
 
-    static class EventComparator implements Comparator<Seeding>, Serializable {
+    static class EventComparator implements Comparator<Seeding> {
 
         @Override
         public int compare(Seeding seeding1, Seeding seeding2) {
@@ -54,7 +53,7 @@ public enum SeedingComparators {
 
     }
 
-    static class PlayerComparator implements Comparator<Seeding>, Serializable {
+    static class PlayerComparator implements Comparator<Seeding> {
 
         @Override
         public int compare(Seeding seeding1, Seeding seeding2) {
@@ -63,7 +62,7 @@ public enum SeedingComparators {
 
     }
 
-    static class SeedingComparator implements Comparator<Seeding>, Serializable {
+    static class SeedingComparator implements Comparator<Seeding> {
 
         @Override
         public int compare(Seeding seeding1, Seeding seeding2) {
index 69c9f13..11f300d 100644 (file)
@@ -36,9 +36,11 @@ import org.hedgecode.snooker.api.IdEntity;
 public abstract class JsonCollectionEntity<E extends IdEntity>
         implements CollectionEntity<E>, Serializable
 {
+    private static final long serialVersionUID = 6302642716627217361L;
+
     private final Map<Integer, E> entities = new LinkedHashMap<>();
 
-    protected JsonCollectionEntity(E[] entities) {
+    JsonCollectionEntity(E[] entities) {
         for (E entity : entities) {
             if (entity != null)
                 this.entities.put(
@@ -47,7 +49,7 @@ public abstract class JsonCollectionEntity<E extends IdEntity>
         }
     }
 
-    protected JsonCollectionEntity(List<E> entities) {
+    JsonCollectionEntity(List<E> entities) {
         for (E entity : entities) {
             this.entities.put(
                     entity.getId(), entity
index 9b1eece..526389f 100644 (file)
@@ -16,6 +16,7 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
 import java.util.Date;
 
 import com.google.gson.annotations.Expose;
@@ -34,7 +35,9 @@ import org.hedgecode.snooker.api.Season;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonEvent extends JsonIdEntity implements Event {
+public class JsonEvent extends JsonIdEntity implements Event, Serializable {
+
+    private static final long serialVersionUID = 3074418501643772690L;
 
     @SerializedName("ID")
     private int eventId;
@@ -127,7 +130,7 @@ public class JsonEvent extends JsonIdEntity implements Event {
     @Expose
     private Event previousEdition;
 
-    protected JsonEvent() {
+    JsonEvent() {
     }
 
     @Override
index 4a7aec7..d536507 100644 (file)
@@ -16,6 +16,7 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
@@ -31,15 +32,17 @@ import org.hedgecode.snooker.compare.EventComparators;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonEvents extends JsonCollectionEntity<Event> implements Events {
+public class JsonEvents extends JsonCollectionEntity<Event> implements Events, Serializable {
+
+    private static final long serialVersionUID = 3333612126168481839L;
 
     private static final JsonEvents EMPTY = new JsonEvents(new Event[0]);
 
-    protected JsonEvents(Event[] entities) {
+    JsonEvents(Event[] entities) {
         super(entities);
     }
 
-    protected JsonEvents(List<Event> entities) {
+    JsonEvents(List<Event> entities) {
         super(entities);
     }
 
index 4ee0c88..ec84274 100644 (file)
@@ -16,8 +16,6 @@
 
 package org.hedgecode.snooker.json;
 
-import java.io.Serializable;
-
 import org.hedgecode.snooker.api.IdEntity;
 
 /**
@@ -25,10 +23,8 @@ import org.hedgecode.snooker.api.IdEntity;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public abstract class JsonIdEntity
-        extends JsonURLEntity
-        implements IdEntity, Serializable
-{
+public abstract class JsonIdEntity extends JsonURLEntity implements IdEntity {
+
     @Override
     public boolean equals(Object obj) {
         if (this == obj)
@@ -43,9 +39,8 @@ public abstract class JsonIdEntity
 
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + getId();
+        int result = getClass().getSimpleName().hashCode();
+        result = 31 * result + getId();
         return result;
     }
 
index f593735..3a2ad3d 100644 (file)
@@ -16,6 +16,7 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
 import java.util.Date;
 
 import com.google.gson.annotations.Expose;
@@ -32,7 +33,9 @@ import org.hedgecode.snooker.api.Player;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonMatch extends JsonIdEntity implements Match {
+public class JsonMatch extends JsonIdEntity implements Match, Serializable {
+
+    private static final long serialVersionUID = 1503003854433798119L;
 
     @SerializedName("ID")
     private int matchId;
@@ -112,7 +115,7 @@ public class JsonMatch extends JsonIdEntity implements Match {
     @SerializedName("ExtendedNote")
     private String extendedNote;
 
-    protected JsonMatch() {
+    JsonMatch() {
     }
 
     @Override
index fa99374..70698da 100644 (file)
@@ -16,6 +16,7 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -28,15 +29,17 @@ import org.hedgecode.snooker.compare.MatchComparators;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonMatches extends JsonCollectionEntity<Match> implements Matches {
+public class JsonMatches extends JsonCollectionEntity<Match> implements Matches, Serializable {
+
+    private static final long serialVersionUID = 7399435317464241002L;
 
     private static final JsonMatches EMPTY = new JsonMatches(new Match[0]);
 
-    protected JsonMatches(Match[] entities) {
+    JsonMatches(Match[] entities) {
         super(entities);
     }
 
-    protected JsonMatches(List<Match> entities) {
+    JsonMatches(List<Match> entities) {
         super(entities);
     }
 
index 33530c2..1bbb18c 100644 (file)
@@ -16,6 +16,8 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
+
 import org.hedgecode.snooker.api.OngoingMatch;
 
 /**
@@ -23,9 +25,11 @@ import org.hedgecode.snooker.api.OngoingMatch;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonOngoingMatch extends JsonMatch implements OngoingMatch {
+public class JsonOngoingMatch extends JsonMatch implements OngoingMatch, Serializable {
+
+    private static final long serialVersionUID = -6395358544537389727L;
 
-    protected JsonOngoingMatch() {
+    JsonOngoingMatch() {
     }
 
 }
index 427ebfd..3d939d6 100644 (file)
@@ -16,6 +16,8 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
+
 import org.hedgecode.snooker.api.OngoingMatch;
 import org.hedgecode.snooker.api.OngoingMatches;
 
@@ -25,9 +27,12 @@ import org.hedgecode.snooker.api.OngoingMatches;
  * @author Dmitry Samoshin aka gotty
  */
 public class JsonOngoingMatches
-        extends JsonCollectionEntity<OngoingMatch> implements OngoingMatches
+        extends JsonCollectionEntity<OngoingMatch>
+        implements OngoingMatches, Serializable
 {
-    protected JsonOngoingMatches(OngoingMatch[] entities) {
+    private static final long serialVersionUID = 1026260972671849624L;
+
+    JsonOngoingMatches(OngoingMatch[] entities) {
         super(entities);
     }
 
index 43be4fd..51a6e89 100644 (file)
@@ -16,6 +16,7 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
 import java.net.URL;
 import java.util.Date;
 
@@ -33,7 +34,9 @@ import org.hedgecode.snooker.api.PlayerImage;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonPlayer extends JsonIdEntity implements Player {
+public class JsonPlayer extends JsonIdEntity implements Player, Serializable {
+
+    private static final long serialVersionUID = 5978347071162091429L;
 
     @SerializedName("ID")
     private int playerId;
@@ -90,7 +93,7 @@ public class JsonPlayer extends JsonIdEntity implements Player {
     @SerializedName("Info")
     private String info;
 
-    protected JsonPlayer() {
+    JsonPlayer() {
     }
 
     @Override
index 8503521..2c4e65f 100644 (file)
@@ -16,6 +16,7 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -28,15 +29,17 @@ import org.hedgecode.snooker.compare.PlayerComparators;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonPlayers extends JsonCollectionEntity<Player> implements Players {
+public class JsonPlayers extends JsonCollectionEntity<Player> implements Players, Serializable {
+
+    private static final long serialVersionUID = 7472642207778686468L;
 
     private static final JsonPlayers EMPTY = new JsonPlayers(new Player[0]);
 
-    protected JsonPlayers(Player[] entities) {
+    JsonPlayers(Player[] entities) {
         super(entities);
     }
 
-    protected JsonPlayers(List<Player> entities) {
+    JsonPlayers(List<Player> entities) {
         super(entities);
     }
 
index 572d599..6be0124 100644 (file)
@@ -16,6 +16,8 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
+
 import com.google.gson.annotations.Expose;
 import com.google.gson.annotations.SerializedName;
 
@@ -29,7 +31,9 @@ import org.hedgecode.snooker.api.Season;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonRanking extends JsonIdEntity implements Ranking {
+public class JsonRanking extends JsonIdEntity implements Ranking, Serializable {
+
+    private static final long serialVersionUID = -8009582917499815478L;
 
     @SerializedName("ID")
     private int rankingId;
@@ -50,7 +54,7 @@ public class JsonRanking extends JsonIdEntity implements Ranking {
     @Expose
     private RankingType rankingType;
 
-    protected JsonRanking() {
+    JsonRanking() {
     }
 
     @Override
index 0cb9d54..d00a814 100644 (file)
@@ -16,6 +16,7 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -28,15 +29,17 @@ import org.hedgecode.snooker.compare.RankingComparators;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonRankings extends JsonCollectionEntity<Ranking> implements Rankings {
+public class JsonRankings extends JsonCollectionEntity<Ranking> implements Rankings, Serializable {
+
+    private static final long serialVersionUID = -1765390719034378729L;
 
     private static final JsonRankings EMPTY = new JsonRankings(new Ranking[0]);
 
-    protected JsonRankings(Ranking[] entities) {
+    JsonRankings(Ranking[] entities) {
         super(entities);
     }
 
-    protected JsonRankings(List<Ranking> entities) {
+    JsonRankings(List<Ranking> entities) {
         super(entities);
     }
 
index 89921ec..2737cac 100644 (file)
@@ -16,6 +16,8 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
+
 import com.google.gson.annotations.Expose;
 import com.google.gson.annotations.SerializedName;
 
@@ -28,7 +30,9 @@ import org.hedgecode.snooker.api.Round;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonRound extends JsonIdEntity implements Round {
+public class JsonRound extends JsonIdEntity implements Round, Serializable {
+
+    private static final long serialVersionUID = -2010008975829800984L;
 
     @SerializedName("Round")
     private int round;
@@ -70,7 +74,7 @@ public class JsonRound extends JsonIdEntity implements Round {
     @SerializedName("SeedPoints")
     private int seedPoints;
 
-    protected JsonRound() {
+    JsonRound() {
     }
 
     @Override
index 11a75e7..44e5b9d 100644 (file)
@@ -16,6 +16,7 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -28,15 +29,17 @@ import org.hedgecode.snooker.compare.RoundComparators;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonRounds extends JsonCollectionEntity<Round> implements Rounds {
+public class JsonRounds extends JsonCollectionEntity<Round> implements Rounds, Serializable {
+
+    private static final long serialVersionUID = -292582814222405882L;
 
     private static final JsonRounds EMPTY = new JsonRounds(new Round[0]);
 
-    protected JsonRounds(Round[] entities) {
+    JsonRounds(Round[] entities) {
         super(entities);
     }
 
-    protected JsonRounds(List<Round> entities) {
+    JsonRounds(List<Round> entities) {
         super(entities);
     }
 
index 8b9f9ff..30dfd43 100644 (file)
@@ -16,6 +16,8 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
+
 import com.google.gson.annotations.Expose;
 import com.google.gson.annotations.SerializedName;
 
@@ -28,7 +30,9 @@ import org.hedgecode.snooker.api.Seeding;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonSeeding extends JsonIdEntity implements Seeding {
+public class JsonSeeding extends JsonIdEntity implements Seeding, Serializable {
+
+    private static final long serialVersionUID = -9182126924854384725L;
 
     @SerializedName("EventID")
     private int eventId;
@@ -41,7 +45,7 @@ public class JsonSeeding extends JsonIdEntity implements Seeding {
     @SerializedName("Seeding")
     private int seeding;
 
-    protected JsonSeeding() {
+    JsonSeeding() {
     }
 
     @Override
index 3b71237..6c3ef8c 100644 (file)
@@ -16,6 +16,7 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -28,15 +29,17 @@ import org.hedgecode.snooker.compare.SeedingComparators;
  *
  * @author Dmitry Samoshin aka gotty
  */
-public class JsonSeedings extends JsonCollectionEntity<Seeding> implements Seedings {
+public class JsonSeedings extends JsonCollectionEntity<Seeding> implements Seedings, Serializable {
+
+    private static final long serialVersionUID = 8251290277292098461L;
 
     private static final JsonSeedings EMPTY = new JsonSeedings(new Seeding[0]);
 
-    protected JsonSeedings(Seeding[] entities) {
+    JsonSeedings(Seeding[] entities) {
         super(entities);
     }
 
-    protected JsonSeedings(List<Seeding> entities) {
+    JsonSeedings(List<Seeding> entities) {
         super(entities);
     }
 
index cb8f2c7..d42fd4d 100644 (file)
@@ -80,6 +80,12 @@ public abstract class AbstractJsonTest extends Assert {
         return sb.toString();
     }
 
+    protected void verifySerialize(Serializable serializeObject) throws IOException {
+        if (!serializeFile.exists()) {
+            serialize(serializeObject);
+        }
+    }
+
     protected void serialize(Serializable serializeObject) throws IOException {
         try (ObjectOutputStream oos =
                      new ObjectOutputStream(
index 1421a96..dd24814 100644 (file)
@@ -36,7 +36,7 @@ public class JsonEventTest extends AbstractJsonTest {
                 ),
                 JsonEvent[].class
         );
-        //serialize(jsonEvents[0]);
+        verifySerialize(jsonEvents[0]);
         JsonEvent expectedEvent = (JsonEvent) deserialize();
         assertNull(
                 expectedEvent,
index c5fb327..5fe91eb 100644 (file)
@@ -40,7 +40,7 @@ public class JsonEventsTest extends AbstractJsonTest {
                         JsonEvent[].class
                 )
         );
-        //serialize(actualEvents);
+        verifySerialize(actualEvents);
         JsonEvents expectedEvents = (JsonEvents) deserialize();
         assertEquals(
                 expectedEvents,
index e9e31ea..0fd040e 100644 (file)
@@ -36,7 +36,7 @@ public class JsonMatchTest extends AbstractJsonTest {
                 ),
                 JsonMatch[].class
         );
-        //serialize(jsonMatches[0]);
+        verifySerialize(jsonMatches[0]);
         JsonMatch expectedMatch = (JsonMatch) deserialize();
         assertNull(
                 expectedMatch,
index 7db2941..9a17f33 100644 (file)
@@ -40,7 +40,7 @@ public class JsonMatchesTest extends AbstractJsonTest {
                         JsonMatch[].class
                 )
         );
-        //serialize(actualMatches);
+        verifySerialize(actualMatches);
         JsonMatches expectedMatches = (JsonMatches) deserialize();
         assertEquals(
                 expectedMatches,
index c778cd8..8739b49 100644 (file)
@@ -36,7 +36,7 @@ public class JsonOngoingMatchTest extends JsonMatchTest {
                 ),
                 JsonOngoingMatch[].class
         );
-        //serialize(jsonOngoingMatches[0]);
+        verifySerialize(jsonOngoingMatches[0]);
         JsonOngoingMatch expectedOngoingMatch = (JsonOngoingMatch) deserialize();
         assertNull(
                 expectedOngoingMatch,
index ee96b6c..870f654 100644 (file)
@@ -40,7 +40,7 @@ public class JsonOngoingMatchesTest extends AbstractJsonTest {
                         JsonOngoingMatch[].class
                 )
         );
-        //serialize(actualOngoingMatches);
+        verifySerialize(actualOngoingMatches);
         JsonOngoingMatches expectedOngoingMatches = (JsonOngoingMatches) deserialize();
         assertEquals(
                 expectedOngoingMatches,
index be885d1..654facd 100644 (file)
@@ -36,7 +36,7 @@ public class JsonPlayerTest extends AbstractJsonTest {
                 ),
                 JsonPlayer[].class
         );
-        //serialize(jsonPlayers[0]);
+        verifySerialize(jsonPlayers[0]);
         JsonPlayer expectedPlayer = (JsonPlayer) deserialize();
         assertNull(
                 expectedPlayer,
index d0b7fc3..46e62d4 100644 (file)
@@ -40,7 +40,7 @@ public class JsonPlayersTest extends AbstractJsonTest {
                         JsonPlayer[].class
                 )
         );
-        //serialize(actualPlayers);
+        verifySerialize(actualPlayers);
         JsonPlayers expectedPlayers = (JsonPlayers) deserialize();
         assertEquals(
                 expectedPlayers,
index 63a3ef0..a6b8afe 100644 (file)
@@ -36,7 +36,7 @@ public class JsonRankingTest extends AbstractJsonTest {
                 ),
                 JsonRanking[].class
         );
-        //serialize(jsonRankings[0]);
+        verifySerialize(jsonRankings[0]);
         JsonRanking expectedRanking = (JsonRanking) deserialize();
         assertNull(
                 expectedRanking,
index bcec928..fc0e7c7 100644 (file)
@@ -40,7 +40,7 @@ public class JsonRankingsTest extends AbstractJsonTest {
                         JsonRanking[].class
                 )
         );
-        //serialize(actualRankings);
+        verifySerialize(actualRankings);
         JsonRankings expectedRankings = (JsonRankings) deserialize();
         assertEquals(
                 expectedRankings,
index b3c4629..7dad5e8 100644 (file)
@@ -36,7 +36,7 @@ public class JsonRoundTest extends AbstractJsonTest {
                 ),
                 JsonRound[].class
         );
-        //serialize(jsonRounds[0]);
+        verifySerialize(jsonRounds[0]);
         JsonRound expectedRound = (JsonRound) deserialize();
         assertNull(
                 expectedRound,
index cb06cea..27fef6f 100644 (file)
@@ -40,7 +40,7 @@ public class JsonRoundsTest extends AbstractJsonTest {
                         JsonRound[].class
                 )
         );
-        //serialize(actualRounds);
+        verifySerialize(actualRounds);
         JsonRounds expectedRounds = (JsonRounds) deserialize();
         assertEquals(
                 expectedRounds,
index 48d21fe..5140b71 100644 (file)
@@ -36,7 +36,7 @@ public class JsonSeedingTest extends AbstractJsonTest {
                 ),
                 JsonSeeding[].class
         );
-        //serialize(jsonSeedings[0]);
+        verifySerialize(jsonSeedings[0]);
         JsonSeeding expectedSeeding = (JsonSeeding) deserialize();
         assertNull(
                 expectedSeeding,
index 5f20446..6a7ca1a 100644 (file)
@@ -40,7 +40,7 @@ public class JsonSeedingsTest extends AbstractJsonTest {
                         JsonSeeding[].class
                 )
         );
-        //serialize(actualSeedings);
+        verifySerialize(actualSeedings);
         JsonSeedings expectedSeedings = (JsonSeedings) deserialize();
         assertEquals(
                 expectedSeedings,
index 51976bd..ece4903 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonEventTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonEventTest.ser differ
index 46c3604..fca110c 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonEventsTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonEventsTest.ser differ
index b27434c..bc153e4 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonMatchTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonMatchTest.ser differ
index 02d6906..653f0c3 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonMatchesTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonMatchesTest.ser differ
index 71ee53e..96c0967 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonOngoingMatchTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonOngoingMatchTest.ser differ
index 6094761..64637c0 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonOngoingMatchesTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonOngoingMatchesTest.ser differ
index 55712f3..c50eb12 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonPlayerTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonPlayerTest.ser differ
index a1d09f2..fbfea46 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonPlayersTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonPlayersTest.ser differ
index e3ae79b..7675fc6 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonRankingTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonRankingTest.ser differ
index 0417587..0abe854 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonRankingsTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonRankingsTest.ser differ
index 5c9cbb3..9c69a01 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonRoundTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonRoundTest.ser differ
index 1615f48..7e9d6ff 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonRoundsTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonRoundsTest.ser differ
index 3643276..9eaf365 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonSeedingTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonSeedingTest.ser differ
index cf56160..7b5e275 100644 (file)
Binary files a/src/test/resources/org/hedgecode/snooker/json/JsonSeedingsTest.ser and b/src/test/resources/org/hedgecode/snooker/json/JsonSeedingsTest.ser differ