Skip to content

Commit

Permalink
FIX: non-coord Mapping.NodeElement
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyxlandlee committed Aug 7, 2022
1 parent 96989fe commit f293d7b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {
}

group = "xland.mcmodbridge"
version = "3.0.3"
version = "3.0.4"

repositories {
maven(url = "https://maven.aliyun.com/repository/public") {
Expand Down
32 changes: 28 additions & 4 deletions src/main/java/xland/mcmodbridge/fa2fomapper/api/Mapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import org.objectweb.asm.Type;

import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.*;

public class Mapping {
private final BiMap<Type, Type> classes;
Expand Down Expand Up @@ -50,6 +47,24 @@ public String getName() {
public Type getDesc() {
return desc;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NodeElement that = (NodeElement) o;
return Objects.equals(owner, that.owner) && Objects.equals(name, that.name) && Objects.equals(desc, that.desc);
}

@Override
public int hashCode() {
return Objects.hash(owner, name, desc);
}

@Override
public String toString() {
return owner + "." + name + ':' + desc;
}
}

public static Builder builder() { return new Builder(); }
Expand Down Expand Up @@ -196,4 +211,13 @@ public NodeElement mapMethod(NodeElement element) {
public static Mapping empty() {
return new Mapping(ImmutableBiMap.of(), Collections.emptyMap(), Collections.emptyMap());
}

@Override
public String toString() {
return "Mapping{" +
"classes=" + classes +
", fields=" + fields +
", methods=" + methods +
'}';
}
}

0 comments on commit f293d7b

Please sign in to comment.