blob: 7742272027f48b4186d48e25547ed4fe358d0f40 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
package cuchaz.enigma.mapping.entry;
import com.google.common.base.Preconditions;
import cuchaz.enigma.mapping.TypeDescriptor;
import cuchaz.enigma.utils.Utils;
/**
* TypeDescriptor...
* Created by Thog
* 19/10/2016
*/
public class LocalVariableDefEntry extends LocalVariableEntry {
protected final MethodDefEntry ownerEntry;
protected final TypeDescriptor desc;
public LocalVariableDefEntry(MethodDefEntry ownerEntry, int index, String name, TypeDescriptor desc) {
super(ownerEntry, index, name);
Preconditions.checkNotNull(desc, "Variable desc cannot be null");
this.ownerEntry = ownerEntry;
this.desc = desc;
}
@Override
public MethodDefEntry getOwnerEntry() {
return this.ownerEntry;
}
public TypeDescriptor getDesc() {
return desc;
}
@Override
public LocalVariableDefEntry updateOwnership(ClassEntry classEntry) {
return new LocalVariableDefEntry(ownerEntry.updateOwnership(classEntry), index, name, desc);
}
@Override
public int hashCode() {
return Utils.combineHashesOrdered(this.ownerEntry, this.desc.hashCode(), this.name.hashCode(), Integer.hashCode(this.index));
}
@Override
public boolean equals(Object other) {
return other instanceof LocalVariableDefEntry && equals((LocalVariableDefEntry) other);
}
public boolean equals(LocalVariableDefEntry other) {
return this.ownerEntry.equals(other.ownerEntry) && this.desc.equals(other.desc) && this.name.equals(other.name) && this.index == other.index;
}
@Override
public String toString() {
return this.ownerEntry + "(" + this.index + ":" + this.name + ":" + this.desc + ")";
}
}
|