hashCode and equals

This commit is contained in:
2015-07-12 18:14:26 +02:00
parent 904d1f64f1
commit 9a0a54bebb
24 changed files with 160 additions and 128 deletions
@@ -27,6 +27,7 @@ import com.jpexs.decompiler.flash.types.RGB;
import com.jpexs.decompiler.flash.types.RGBA;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.TreeMap;
/**
@@ -41,7 +42,7 @@ public class Frame implements TreeItem, Exportable {
public RGB backgroundColor = new RGBA(0, 0, 0, 0);
public Timeline timeline;
public final Timeline timeline;
public List<Integer> sounds = new ArrayList<>();
@@ -92,7 +93,7 @@ public class Frame implements TreeItem, Exportable {
public boolean equals(Object obj) {
if (obj instanceof Frame) {
Frame frameObj = (Frame) obj;
return timeline.equals(frameObj.timeline) && frame == frameObj.frame;
return Objects.equals(timeline, frameObj.timeline) && frame == frameObj.frame;
}
return false;
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.base.Exportable;
import com.jpexs.decompiler.flash.treeitems.TreeItem;
import java.util.List;
import java.util.Objects;
/**
*
@@ -66,7 +67,7 @@ public class TagScript implements TreeItem, Exportable {
@Override
public boolean equals(Object obj) {
if (obj instanceof TagScript) {
return tag.equals(((TagScript) obj).getTag());
return Objects.equals(tag, ((TagScript) obj).tag);
}
return false;