summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventList.java
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-03-19 22:58:24 -0400
committerStarla Insigna <hatkirby@fourisland.com>2009-03-19 22:58:24 -0400
commitfc3afd1d6460b2aa453167498979bbf7a636ef45 (patch)
tree390d5003901ec8b6e951dae2daedb485033c8b6e /src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventList.java
parent0ebc2f2c92e4b51069f497aca9f715198010bdf2 (diff)
downloadfourpuzzle-fc3afd1d6460b2aa453167498979bbf7a636ef45.tar.gz
fourpuzzle-fc3afd1d6460b2aa453167498979bbf7a636ef45.tar.bz2
fourpuzzle-fc3afd1d6460b2aa453167498979bbf7a636ef45.zip
Engine: Fixed many potential bugs
Identified by FindBugs. http://findbugs.sourceforge.net/
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventList.java')
-rwxr-xr-xsrc/com/fourisland/fourpuzzle/gamestate/mapview/event/EventList.java34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventList.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventList.java index 7120a91..d790195 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventList.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventList.java
@@ -14,6 +14,8 @@ import java.util.Vector;
14 */ 14 */
15public class EventList extends Vector<LayerEvent> { 15public class EventList extends Vector<LayerEvent> {
16 16
17 private static final long serialVersionUID = 765438545;
18
17 public EventList(Map parentMap) 19 public EventList(Map parentMap)
18 { 20 {
19 setParentMap(parentMap); 21 setParentMap(parentMap);
@@ -62,7 +64,7 @@ public class EventList extends Vector<LayerEvent> {
62 return super.add(o); 64 return super.add(o);
63 } 65 }
64 66
65 private Map parentMap = null; 67 private transient Map parentMap = null;
66 public Map getParentMap() 68 public Map getParentMap()
67 { 69 {
68 return parentMap; 70 return parentMap;
@@ -77,4 +79,34 @@ public class EventList extends Vector<LayerEvent> {
77 } 79 }
78 } 80 }
79 81
82 @Override
83 public int hashCode()
84 {
85 int hash = 3;
86 hash = 59 * hash + (this.parentMap != null ? this.parentMap.hashCode() : 0);
87 return hash;
88 }
89
90 @Override
91 public boolean equals(Object obj)
92 {
93 if (obj == null)
94 {
95 return false;
96 }
97
98 if (getClass() != obj.getClass())
99 {
100 return false;
101 }
102
103 final EventList other = (EventList) obj;
104 if (this.parentMap != other.parentMap && (this.parentMap == null || !this.parentMap.equals(other.parentMap)))
105 {
106 return false;
107 }
108
109 return true;
110 }
111
80} 112}