From f77d3948df071e753c21d99e8a2bc23410b57b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 8 Mar 2021 09:32:15 +0100 Subject: [PATCH] valueEquals implemented for AS1/2 --- .../action/model/AsciiToCharActionItem.java | 18 ++++++ .../flash/action/model/CallActionItem.java | 18 ++++++ .../action/model/CallFunctionActionItem.java | 18 ++++++ .../action/model/CallMethodActionItem.java | 24 ++++++++ .../flash/action/model/CastOpActionItem.java | 21 +++++++ .../action/model/CharToAsciiActionItem.java | 18 ++++++ .../action/model/CloneSpriteActionItem.java | 59 +++++++++++++++++++ .../action/model/DecrementActionItem.java | 18 ++++++ .../action/model/DefineLocalActionItem.java | 21 +++++++ .../flash/action/model/DeleteActionItem.java | 21 +++++++ .../action/model/DirectValueActionItem.java | 6 +- .../action/model/EnumerateActionItem.java | 18 ++++++ .../flash/action/model/EvalActionItem.java | 18 ++++++ .../flash/action/model/ExtendsActionItem.java | 21 +++++++ .../action/model/FSCommand2ActionItem.java | 21 +++++++ .../action/model/FSCommandActionItem.java | 18 ++++++ .../action/model/GetMemberActionItem.java | 18 ++++++ .../action/model/GetPropertyActionItem.java | 21 +++++++ .../flash/action/model/GetURL2ActionItem.java | 24 ++++++++ .../flash/action/model/GetURLActionItem.java | 22 +++++++ .../action/model/GotoFrame2ActionItem.java | 27 +++++++++ .../action/model/ImplementsOpActionItem.java | 21 +++++++ .../action/model/IncrementActionItem.java | 18 ++++++ .../action/model/InitArrayActionItem.java | 18 ++++++ .../action/model/InitObjectActionItem.java | 21 +++++++ .../action/model/LoadMovieActionItem.java | 24 ++++++++ .../action/model/LoadMovieNumActionItem.java | 23 ++++++++ .../action/model/LoadVariablesActionItem.java | 24 ++++++++ .../model/LoadVariablesNumActionItem.java | 24 ++++++++ .../action/model/MBAsciiToCharActionItem.java | 18 ++++++ .../action/model/MBCharToAsciiActionItem.java | 18 ++++++ .../model/MBStringExtractActionItem.java | 24 ++++++++ .../model/MBStringLengthActionItem.java | 18 ++++++ .../action/model/NewMethodActionItem.java | 24 ++++++++ .../action/model/NewObjectActionItem.java | 21 +++++++ .../action/model/PostDecrementActionItem.java | 18 ++++++ .../action/model/PostIncrementActionItem.java | 18 ++++++ .../flash/action/model/PrintActionItem.java | 21 +++++++ .../action/model/PrintAsBitmapActionItem.java | 21 +++++++ .../model/PrintAsBitmapNumActionItem.java | 21 +++++++ .../action/model/PrintNumActionItem.java | 21 +++++++ .../action/model/RandomNumberActionItem.java | 18 ++++++ .../action/model/RemoveSpriteActionItem.java | 18 ++++++ .../flash/action/model/ReturnActionItem.java | 18 ++++++ .../action/model/SetMemberActionItem.java | 24 ++++++++ .../action/model/SetPropertyActionItem.java | 24 ++++++++ .../action/model/SetTarget2ActionItem.java | 18 ++++++ .../action/model/SetTargetActionItem.java | 19 ++++++ .../action/model/SetVariableActionItem.java | 21 +++++++ .../action/model/StartDragActionItem.java | 36 +++++++++++ .../action/model/StoreRegisterActionItem.java | 21 +++++++ .../action/model/StringExtractActionItem.java | 23 ++++++++ .../action/model/StringLengthActionItem.java | 18 ++++++ .../action/model/TargetPathActionItem.java | 18 ++++++ .../flash/action/model/TemporaryRegister.java | 21 +++++++ .../flash/action/model/ThrowActionItem.java | 18 ++++++ .../action/model/ToIntegerActionItem.java | 18 ++++++ .../action/model/ToNumberActionItem.java | 18 ++++++ .../action/model/ToStringActionItem.java | 18 ++++++ .../flash/action/model/TraceActionItem.java | 18 ++++++ .../flash/action/model/TypeOfActionItem.java | 18 ++++++ .../action/model/UnLoadMovieActionItem.java | 18 ++++++ .../model/UnLoadMovieNumActionItem.java | 18 ++++++ .../action/model/UnsupportedActionItem.java | 19 ++++++ .../flash/action/swf4/ActionSetVariable.java | 2 +- .../flash/action/swf5/ActionSetMember.java | 2 +- .../decompiler/graph/GraphTargetItem.java | 28 +++++++++ .../decompiler/graph/model/BinaryOpItem.java | 18 ++++++ .../decompiler/graph/model/UnaryOpItem.java | 18 ++++++ 69 files changed, 1389 insertions(+), 5 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java index ea347a678..87a7e1376 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java @@ -97,6 +97,24 @@ public class AsciiToCharActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java index a435574d1..d468cf648 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java @@ -82,6 +82,24 @@ public class CallActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java index 60c7cbaeb..2baf88209 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallFunctionActionItem.java @@ -140,6 +140,24 @@ public class CallFunctionActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CallFunctionActionItem other = (CallFunctionActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(functionName, other.functionName)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.arguments, other.arguments)) { + return false; + } + return true; + } + @Override public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { return toSourceMerge(localData, generator, toSourceCall(localData, generator, arguments), functionName, new ActionCallFunction()); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java index ce4c379a3..3a0b6be13 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallMethodActionItem.java @@ -170,6 +170,30 @@ public class CallMethodActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CallMethodActionItem other = (CallMethodActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.methodName, other.methodName)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.scriptObject, other.scriptObject)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.arguments, other.arguments)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java index 02e3ff3ec..1a01df424 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CastOpActionItem.java @@ -107,4 +107,25 @@ public class CastOpActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CastOpActionItem other = (CastOpActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.constructor, other.constructor)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.object, other.object)) { + return false; + } + return true; + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java index a668c8da7..d5b5a9b8a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java @@ -112,6 +112,24 @@ public class CharToAsciiActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java index 5cee87fc4..e7d56dbb8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CloneSpriteActionItem.java @@ -27,6 +27,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface; import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.model.LocalData; import java.util.List; +import java.util.Objects; /** * @@ -90,4 +91,62 @@ public class CloneSpriteActionItem extends ActionItem { public boolean hasSideEffect() { return true; } + + @Override + public int hashCode() { + int hash = 7; + hash = 17 * hash + Objects.hashCode(this.source); + hash = 17 * hash + Objects.hashCode(this.target); + hash = 17 * hash + Objects.hashCode(this.depth); + return hash; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CloneSpriteActionItem other = (CloneSpriteActionItem) obj; + if (!Objects.equals(this.source, other.source)) { + return false; + } + if (!Objects.equals(this.target, other.target)) { + return false; + } + if (!Objects.equals(this.depth, other.depth)) { + return false; + } + return true; + } + + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CloneSpriteActionItem other = (CloneSpriteActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.source, other.source)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.target, other.target)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.depth, other.depth)) { + return false; + } + return true; + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java index 006548936..431d49d8e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DecrementActionItem.java @@ -120,4 +120,22 @@ public class DecrementActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final DecrementActionItem other = (DecrementActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.object, other.object)) { + return false; + } + return true; + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java index 35c2f6d8f..a5eabce3d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java @@ -151,6 +151,27 @@ public class DefineLocalActionItem extends ActionItem implements SetTypeActionIt return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final DefineLocalActionItem other = (DefineLocalActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.name, other.name)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java index b76bb3826..2e8dbfbb7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DeleteActionItem.java @@ -127,6 +127,27 @@ public class DeleteActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final DeleteActionItem other = (DeleteActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.object, other.object)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.propertyName, other.propertyName)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java index 9c85ad59b..0218f9270 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java @@ -239,10 +239,10 @@ public class DirectValueActionItem extends ActionItem implements SimpleValue { if (!Objects.equals(this.constants, other.constants)) { return false; } - //?? - /*if (other.pos != this.pos) { + //!!! + if (other.pos != this.pos) { return false; - }*/ + } return true; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java index be9e84eec..7a4187837 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EnumerateActionItem.java @@ -100,6 +100,24 @@ public class EnumerateActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final EnumerateActionItem other = (EnumerateActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.object, other.object)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java index 93b894d96..2f3836239 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java @@ -74,6 +74,24 @@ public class EvalActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java index e71f7d406..b3d22e5ae 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ExtendsActionItem.java @@ -89,4 +89,25 @@ public class ExtendsActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final ExtendsActionItem other = (ExtendsActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.subclass, other.subclass)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.superclass, other.superclass)) { + return false; + } + return true; + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java index cc4e118c2..86118a4f2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/FSCommand2ActionItem.java @@ -122,6 +122,27 @@ public class FSCommand2ActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final FSCommand2ActionItem other = (FSCommand2ActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.arguments, other.arguments)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.command, other.command)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java index 0dd55f846..53f29bb1a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/FSCommandActionItem.java @@ -91,6 +91,24 @@ public class FSCommandActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final FSCommandActionItem other = (FSCommandActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.command, other.command)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java index 5b4d345c8..1c500cad4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetMemberActionItem.java @@ -110,6 +110,24 @@ public class GetMemberActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GetMemberActionItem other = (GetMemberActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(object, other.object)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(memberName, other.memberName)) { + return false; + } + return true; + } + @Override public List toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException { return toSourceMerge(localData, generator, object, memberName, new ActionGetMember()); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java index c65ff33ba..fc9be251e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetPropertyActionItem.java @@ -106,6 +106,27 @@ public class GetPropertyActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GetPropertyActionItem other = (GetPropertyActionItem) obj; + if (this.propertyIndex != other.propertyIndex) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.target, other.target)) { + return false; + } + return true; + } + @Override public List getNeededSources() { List ret = super.getNeededSources(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java index e95e24ff4..b1c8bc283 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURL2ActionItem.java @@ -124,6 +124,30 @@ public class GetURL2ActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GetURL2ActionItem other = (GetURL2ActionItem) obj; + if (this.sendVarsMethod != other.sendVarsMethod) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.urlString, other.urlString)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.targetString, other.targetString)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java index f099805d2..b2ce28c72 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GetURLActionItem.java @@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.action.swf3.ActionGetURL; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.model.LocalData; import com.jpexs.helpers.Helper; @@ -93,6 +94,27 @@ public class GetURLActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GetURLActionItem other = (GetURLActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.urlString, other.urlString)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.targetString, other.targetString)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java index 4d535a3c9..60008b54f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/GotoFrame2ActionItem.java @@ -130,6 +130,33 @@ public class GotoFrame2ActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GotoFrame2ActionItem other = (GotoFrame2ActionItem) obj; + if (this.sceneBiasFlag != other.sceneBiasFlag) { + return false; + } + if (this.playFlag != other.playFlag) { + return false; + } + if (this.sceneBias != other.sceneBias) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.frame, other.frame)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java index a3c874f89..8278c26ea 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ImplementsOpActionItem.java @@ -97,4 +97,25 @@ public class ImplementsOpActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final ImplementsOpActionItem other = (ImplementsOpActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.subclass, other.subclass)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.superclasses, other.superclasses)) { + return false; + } + return true; + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java index 4f97387b6..bc0902644 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/IncrementActionItem.java @@ -120,4 +120,22 @@ public class IncrementActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final IncrementActionItem other = (IncrementActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.object, other.object)) { + return false; + } + return true; + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java index 7670b9444..54e7e8bbc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/InitArrayActionItem.java @@ -103,6 +103,24 @@ public class InitArrayActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final InitArrayActionItem other = (InitArrayActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.values, other.values)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { for (GraphTargetItem v : values) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java index 0d42a6e8f..3467e8d4f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/InitObjectActionItem.java @@ -132,6 +132,27 @@ public class InitObjectActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final InitObjectActionItem other = (InitObjectActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.names, other.names)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.values, other.values)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { for (GraphTargetItem n : names) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java index 415a71eaa..9cf19baf1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieActionItem.java @@ -114,6 +114,30 @@ public class LoadMovieActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final LoadMovieActionItem other = (LoadMovieActionItem) obj; + if (this.method != other.method) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.urlString, other.urlString)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.targetString, other.targetString)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java index 708367de9..7cacc2cec 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadMovieNumActionItem.java @@ -123,6 +123,29 @@ public class LoadMovieNumActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final LoadMovieNumActionItem other = (LoadMovieNumActionItem) obj; + if (this.method != other.method) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.urlString, other.urlString)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.num, other.num)) { + return false; + } + return true; + } @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java index a474f600a..da68f1758 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesActionItem.java @@ -114,6 +114,30 @@ public class LoadVariablesActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final LoadVariablesActionItem other = (LoadVariablesActionItem) obj; + if (this.method != other.method) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.urlString, other.urlString)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.targetString, other.targetString)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java index 704cb327e..6ea3baa9c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/LoadVariablesNumActionItem.java @@ -123,6 +123,30 @@ public class LoadVariablesNumActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final LoadVariablesNumActionItem other = (LoadVariablesNumActionItem) obj; + if (this.method != other.method) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.urlString, other.urlString)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.num, other.num)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java index d4b199a0c..8c60e3000 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java @@ -97,6 +97,24 @@ public class MBAsciiToCharActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java index af24b835e..af33546c7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java @@ -97,6 +97,24 @@ public class MBCharToAsciiActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java index 70145a169..f0e38d7e7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java @@ -146,4 +146,28 @@ public class MBStringExtractActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final MBStringExtractActionItem other = (MBStringExtractActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.index, other.index)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.count, other.count)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java index 15e8f87a9..b09771ecf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java @@ -98,6 +98,24 @@ public class MBStringLengthActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java index cee03fc60..c70627786 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/NewMethodActionItem.java @@ -149,6 +149,30 @@ public class NewMethodActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final NewMethodActionItem other = (NewMethodActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.methodName, other.methodName)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.scriptObject, other.scriptObject)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.arguments, other.arguments)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java index fcb9df4a3..96ce4b961 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/NewObjectActionItem.java @@ -115,6 +115,27 @@ public class NewObjectActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final NewObjectActionItem other = (NewObjectActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.objectName, other.objectName)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.arguments, other.arguments)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java index c34902ee1..a13bd24ba 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PostDecrementActionItem.java @@ -174,6 +174,24 @@ public class PostDecrementActionItem extends ActionItem implements SetTypeAction return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final PostDecrementActionItem other = (PostDecrementActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.object, other.object)) { + return false; + } + return true; + } + @Override public GraphTargetItem getCompoundValue() { throw new UnsupportedOperationException("Not supported."); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java index a2f13a473..996269a65 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PostIncrementActionItem.java @@ -174,6 +174,24 @@ public class PostIncrementActionItem extends ActionItem implements SetTypeAction return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final PostIncrementActionItem other = (PostIncrementActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.object, other.object)) { + return false; + } + return true; + } + @Override public GraphTargetItem getCompoundValue() { throw new UnsupportedOperationException("Not supported."); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java index c0ed8c38e..bead5b998 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintActionItem.java @@ -103,6 +103,27 @@ public class PrintActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final PrintActionItem other = (PrintActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.target, other.target)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.boundingBox, other.boundingBox)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java index 8ee7a4f58..a95dd6dec 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapActionItem.java @@ -103,6 +103,27 @@ public class PrintAsBitmapActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final PrintAsBitmapActionItem other = (PrintAsBitmapActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.target, other.target)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.boundingBox, other.boundingBox)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java index 095f8f859..72a9d07e2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintAsBitmapNumActionItem.java @@ -109,6 +109,27 @@ public class PrintAsBitmapNumActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final PrintAsBitmapNumActionItem other = (PrintAsBitmapNumActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.num, other.num)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.boundingBox, other.boundingBox)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java index 17006d219..3c4ee4e31 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/PrintNumActionItem.java @@ -109,6 +109,27 @@ public class PrintNumActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final PrintNumActionItem other = (PrintNumActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.num, other.num)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.boundingBox, other.boundingBox)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java index ce9d29747..83004a9f3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java @@ -94,6 +94,24 @@ public class RandomNumberActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java index 6c2d54718..ad710ddce 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java @@ -82,6 +82,24 @@ public class RemoveSpriteActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java index d321df31c..4246bf877 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java @@ -115,6 +115,24 @@ public class ReturnActionItem extends ActionItem implements ExitItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java index 7be5d80ca..509379519 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java @@ -184,6 +184,30 @@ public class SetMemberActionItem extends ActionItem implements SetTypeActionItem return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final SetMemberActionItem other = (SetMemberActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.object, other.object)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.objectName, other.objectName)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public GraphTargetItem getCompoundValue() { return compoundValue; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java index f76bd2bb7..35d5d89f2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java @@ -167,6 +167,30 @@ public class SetPropertyActionItem extends ActionItem implements SetTypeActionIt return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final SetPropertyActionItem other = (SetPropertyActionItem) obj; + if (this.propertyIndex != other.propertyIndex) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.target, other.target)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public GraphTargetItem getCompoundValue() { throw new UnsupportedOperationException("Not supported."); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java index 5ee368784..b98e80382 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetTarget2ActionItem.java @@ -91,6 +91,24 @@ public class SetTarget2ActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final SetTarget2ActionItem other = (SetTarget2ActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.target, other.target)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java index 0f6204188..ee4ab96c4 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetTargetActionItem.java @@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.SourceGeneratorLocalData; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.CompilationException; import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.SourceGenerator; import com.jpexs.decompiler.graph.model.LocalData; import com.jpexs.helpers.Helper; @@ -81,6 +82,24 @@ public class SetTargetActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final SetTargetActionItem other = (SetTargetActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.target, other.target)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java index 8b03061cb..bd523dda6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java @@ -184,6 +184,27 @@ public class SetVariableActionItem extends ActionItem implements SetTypeActionIt return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final SetVariableActionItem other = (SetVariableActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.name, other.name)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public GraphTargetItem getCompoundValue() { return compoundValue; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java index bb24739fa..7deb17e14 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StartDragActionItem.java @@ -167,6 +167,42 @@ public class StartDragActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final StartDragActionItem other = (StartDragActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.target, other.target)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.lockCenter, other.lockCenter)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.constrain, other.constrain)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.y2, other.y2)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.x2, other.x2)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.y1, other.y1)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.x1, other.x1)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java index 992ef8a04..00fc45793 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java @@ -174,6 +174,27 @@ public class StoreRegisterActionItem extends ActionItem implements SetTypeAction return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final StoreRegisterActionItem other = (StoreRegisterActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.register, other.register)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java index 98302faee..36503f568 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java @@ -137,4 +137,27 @@ public class StringExtractActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final StringExtractActionItem other = (StringExtractActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.index, other.index)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.count, other.count)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java index 03273b5df..e9ed76070 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java @@ -90,6 +90,24 @@ public class StringLengthActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java index d51aa8365..ae04838e9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java @@ -82,6 +82,24 @@ public class TargetPathActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java index f9a7ac874..e6632c1bb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java @@ -109,4 +109,25 @@ public class TemporaryRegister extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TemporaryRegister other = (TemporaryRegister) obj; + if (this.regId != other.regId) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java index e710bc04d..1660d2cd2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java @@ -79,6 +79,24 @@ public class ThrowActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java index 2b81547d2..cb864cb65 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java @@ -92,6 +92,24 @@ public class ToIntegerActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java index 5c13a06bf..880e53bfb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java @@ -91,6 +91,24 @@ public class ToNumberActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java index 1c1179caf..663026377 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java @@ -92,6 +92,24 @@ public class ToStringActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java index 3ac497a65..0d80cca9e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java @@ -82,6 +82,24 @@ public class TraceActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java index 4a16c4964..0586e32a9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java @@ -119,6 +119,24 @@ public class TypeOfActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java index 244a6a696..4d9793e1f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieActionItem.java @@ -91,6 +91,24 @@ public class UnLoadMovieActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final UnLoadMovieActionItem other = (UnLoadMovieActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.targetString, other.targetString)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java index c21c12df0..432bdc7b7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnLoadMovieNumActionItem.java @@ -100,6 +100,24 @@ public class UnLoadMovieNumActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final UnLoadMovieNumActionItem other = (UnLoadMovieNumActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.num, other.num)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java index 6261b22ca..5b1b0bfec 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/UnsupportedActionItem.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.AppResources; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.graph.GraphSourceItem; +import com.jpexs.decompiler.graph.GraphTargetItem; import com.jpexs.decompiler.graph.model.LocalData; import java.util.Objects; @@ -70,6 +71,24 @@ public class UnsupportedActionItem extends ActionItem { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final UnsupportedActionItem other = (UnsupportedActionItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public boolean hasSideEffect() { return true; //?? diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java index 2c60b3636..d78c028f0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf4/ActionSetVariable.java @@ -122,7 +122,7 @@ public class ActionSetVariable extends Action implements StoreTypeAction { CompoundableBinaryOp binaryOp = (CompoundableBinaryOp) value.getNotCoercedNoDup(); if (binaryOp.getLeftSide() instanceof GetVariableActionItem) { GetVariableActionItem getVar = (GetVariableActionItem) binaryOp.getLeftSide(); - if (Objects.equals(name, getVar.name)) { + if (GraphTargetItem.objectsValueEquals(name, getVar.name)) { setVar.setCompoundValue(binaryOp.getRightSide()); setVar.setCompoundOperator(binaryOp.getOperator()); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionSetMember.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionSetMember.java index 892a5d45e..7cc4ca101 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionSetMember.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/swf5/ActionSetMember.java @@ -121,7 +121,7 @@ public class ActionSetMember extends Action { CompoundableBinaryOp binaryOp = (CompoundableBinaryOp) value.getNotCoercedNoDup(); if (binaryOp.getLeftSide() instanceof GetMemberActionItem) { GetMemberActionItem getMember = (GetMemberActionItem) binaryOp.getLeftSide(); - if (Objects.equals(object, getMember.object.getThroughDuplicate()) && Objects.equals(memberName, getMember.memberName)) { + if (GraphTargetItem.objectsValueEquals(object, getMember.object.getThroughDuplicate()) && GraphTargetItem.objectsValueEquals(memberName, getMember.memberName)) { setMem.setCompoundValue(binaryOp.getRightSide()); setMem.setCompoundOperator(binaryOp.getOperator()); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java index a2790264f..abf7682c7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java @@ -645,4 +645,32 @@ public abstract class GraphTargetItem implements Serializable, Cloneable { public boolean isIdentical(GraphTargetItem other) { return this == other; } + + public static boolean objectsValueEquals(Object o1, Object o2) { + if (o1 == null && o2 == null) { + return true; + } + if (o1 == null || o2 == null) { + return false; + } + if ((o1 instanceof GraphTargetItem) && (o2 instanceof GraphTargetItem)) { + GraphTargetItem gt1 = (GraphTargetItem) o1; + GraphTargetItem gt2 = (GraphTargetItem) o2; + return gt1.valueEquals(gt2); + } + if ((o1 instanceof List) && (o2 instanceof List)) { + List l1 = (List) o1; + List l2 = (List) o2; + + if (l1.size() != l2.size()) { + return false; + } + for (int i = 0; i < l1.size(); i++) { + if (!objectsValueEquals(l1.get(i), l2.get(i))) { + return false; + } + } + } + return o1.equals(o2); + } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java index 0a7ba272c..d26273ca7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java @@ -168,6 +168,24 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp { return (Objects.equals(operator, other.operator)); } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final BinaryOpItem other = (BinaryOpItem) obj; + if (!GraphTargetItem.objectsValueEquals(leftSide, other.leftSide)) { + return false; + } + if (!GraphTargetItem.objectsValueEquals(rightSide, other.rightSide)) { + return false; + } + return GraphTargetItem.objectsValueEquals(operator, other.operator); + } + /*@Override public boolean toBoolean() { double val=toNumber(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java index 9ab979e79..27364217c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java @@ -123,6 +123,24 @@ public abstract class UnaryOpItem extends GraphTargetItem implements UnaryOp { return true; } + @Override + public boolean valueEquals(GraphTargetItem obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final GraphTargetItem other = (GraphTargetItem) obj; + if (!GraphTargetItem.objectsValueEquals(this.value, other.value)) { + return false; + } + return true; + } + @Override public int hashCode() { int hash = 3;