diff options
| author | 2016-07-04 18:14:22 +1000 | |
|---|---|---|
| committer | 2016-07-04 18:14:22 +1000 | |
| commit | 59e189bef2b5e6d129fb7c2c988ed0b2130e36ac (patch) | |
| tree | 2b638e60905251de85a4917152d6fc39a4112194 /src/main/java/cuchaz/enigma/mapping/ArgumentEntry.java | |
| parent | Fixed Obf Class list order (diff) | |
| download | enigma-fork-59e189bef2b5e6d129fb7c2c988ed0b2130e36ac.tar.gz enigma-fork-59e189bef2b5e6d129fb7c2c988ed0b2130e36ac.tar.xz enigma-fork-59e189bef2b5e6d129fb7c2c988ed0b2130e36ac.zip | |
Reformat
Diffstat (limited to 'src/main/java/cuchaz/enigma/mapping/ArgumentEntry.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/mapping/ArgumentEntry.java | 56 |
1 files changed, 21 insertions, 35 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/ArgumentEntry.java b/src/main/java/cuchaz/enigma/mapping/ArgumentEntry.java index 83033bc..1409fc4 100644 --- a/src/main/java/cuchaz/enigma/mapping/ArgumentEntry.java +++ b/src/main/java/cuchaz/enigma/mapping/ArgumentEntry.java | |||
| @@ -10,17 +10,13 @@ | |||
| 10 | ******************************************************************************/ | 10 | ******************************************************************************/ |
| 11 | package cuchaz.enigma.mapping; | 11 | package cuchaz.enigma.mapping; |
| 12 | 12 | ||
| 13 | import java.io.Serializable; | 13 | import cuchaz.enigma.utils.Utils; |
| 14 | 14 | ||
| 15 | import cuchaz.enigma.Util; | 15 | public class ArgumentEntry implements Entry { |
| 16 | 16 | ||
| 17 | public class ArgumentEntry implements Entry, Serializable { | 17 | private BehaviorEntry behaviorEntry; |
| 18 | 18 | private int index; | |
| 19 | private static final long serialVersionUID = 4472172468162696006L; | 19 | private String name; |
| 20 | |||
| 21 | private BehaviorEntry m_behaviorEntry; | ||
| 22 | private int m_index; | ||
| 23 | private String m_name; | ||
| 24 | 20 | ||
| 25 | public ArgumentEntry(BehaviorEntry behaviorEntry, int index, String name) { | 21 | public ArgumentEntry(BehaviorEntry behaviorEntry, int index, String name) { |
| 26 | if (behaviorEntry == null) { | 22 | if (behaviorEntry == null) { |
| @@ -33,44 +29,38 @@ public class ArgumentEntry implements Entry, Serializable { | |||
| 33 | throw new IllegalArgumentException("Argument name cannot be null!"); | 29 | throw new IllegalArgumentException("Argument name cannot be null!"); |
| 34 | } | 30 | } |
| 35 | 31 | ||
| 36 | m_behaviorEntry = behaviorEntry; | 32 | this.behaviorEntry = behaviorEntry; |
| 37 | m_index = index; | 33 | this.index = index; |
| 38 | m_name = name; | 34 | this.name = name; |
| 39 | } | ||
| 40 | |||
| 41 | public ArgumentEntry(ArgumentEntry other) { | ||
| 42 | m_behaviorEntry = (BehaviorEntry) m_behaviorEntry.cloneToNewClass(getClassEntry()); | ||
| 43 | m_index = other.m_index; | ||
| 44 | m_name = other.m_name; | ||
| 45 | } | 35 | } |
| 46 | 36 | ||
| 47 | public ArgumentEntry(ArgumentEntry other, String newClassName) { | 37 | public ArgumentEntry(ArgumentEntry other, String newClassName) { |
| 48 | m_behaviorEntry = (BehaviorEntry) other.m_behaviorEntry.cloneToNewClass(new ClassEntry(newClassName)); | 38 | this.behaviorEntry = (BehaviorEntry) other.behaviorEntry.cloneToNewClass(new ClassEntry(newClassName)); |
| 49 | m_index = other.m_index; | 39 | this.index = other.index; |
| 50 | m_name = other.m_name; | 40 | this.name = other.name; |
| 51 | } | 41 | } |
| 52 | 42 | ||
| 53 | public BehaviorEntry getBehaviorEntry() { | 43 | public BehaviorEntry getBehaviorEntry() { |
| 54 | return m_behaviorEntry; | 44 | return this.behaviorEntry; |
| 55 | } | 45 | } |
| 56 | 46 | ||
| 57 | public int getIndex() { | 47 | public int getIndex() { |
| 58 | return m_index; | 48 | return this.index; |
| 59 | } | 49 | } |
| 60 | 50 | ||
| 61 | @Override | 51 | @Override |
| 62 | public String getName() { | 52 | public String getName() { |
| 63 | return m_name; | 53 | return this.name; |
| 64 | } | 54 | } |
| 65 | 55 | ||
| 66 | @Override | 56 | @Override |
| 67 | public ClassEntry getClassEntry() { | 57 | public ClassEntry getClassEntry() { |
| 68 | return m_behaviorEntry.getClassEntry(); | 58 | return this.behaviorEntry.getClassEntry(); |
| 69 | } | 59 | } |
| 70 | 60 | ||
| 71 | @Override | 61 | @Override |
| 72 | public String getClassName() { | 62 | public String getClassName() { |
| 73 | return m_behaviorEntry.getClassName(); | 63 | return this.behaviorEntry.getClassName(); |
| 74 | } | 64 | } |
| 75 | 65 | ||
| 76 | @Override | 66 | @Override |
| @@ -79,20 +69,16 @@ public class ArgumentEntry implements Entry, Serializable { | |||
| 79 | } | 69 | } |
| 80 | 70 | ||
| 81 | public String getMethodName() { | 71 | public String getMethodName() { |
| 82 | return m_behaviorEntry.getName(); | 72 | return this.behaviorEntry.getName(); |
| 83 | } | 73 | } |
| 84 | 74 | ||
| 85 | public Signature getMethodSignature() { | 75 | public Signature getMethodSignature() { |
| 86 | return m_behaviorEntry.getSignature(); | 76 | return this.behaviorEntry.getSignature(); |
| 87 | } | 77 | } |
| 88 | 78 | ||
| 89 | @Override | 79 | @Override |
| 90 | public int hashCode() { | 80 | public int hashCode() { |
| 91 | return Util.combineHashesOrdered( | 81 | return Utils.combineHashesOrdered(this.behaviorEntry, Integer.valueOf(this.index).hashCode(), this.name.hashCode()); |
| 92 | m_behaviorEntry, | ||
| 93 | Integer.valueOf(m_index).hashCode(), | ||
| 94 | m_name.hashCode() | ||
| 95 | ); | ||
| 96 | } | 82 | } |
| 97 | 83 | ||
| 98 | @Override | 84 | @Override |
| @@ -101,11 +87,11 @@ public class ArgumentEntry implements Entry, Serializable { | |||
| 101 | } | 87 | } |
| 102 | 88 | ||
| 103 | public boolean equals(ArgumentEntry other) { | 89 | public boolean equals(ArgumentEntry other) { |
| 104 | return m_behaviorEntry.equals(other.m_behaviorEntry) && m_index == other.m_index && m_name.equals(other.m_name); | 90 | return this.behaviorEntry.equals(other.behaviorEntry) && this.index == other.index && this.name.equals(other.name); |
| 105 | } | 91 | } |
| 106 | 92 | ||
| 107 | @Override | 93 | @Override |
| 108 | public String toString() { | 94 | public String toString() { |
| 109 | return m_behaviorEntry.toString() + "(" + m_index + ":" + m_name + ")"; | 95 | return this.behaviorEntry.toString() + "(" + this.index + ":" + this.name + ")"; |
| 110 | } | 96 | } |
| 111 | } | 97 | } |