Add Hashcode methods

This commit is contained in:
JanUlrich 2020-10-30 15:44:46 +01:00
parent b45964ed5f
commit 8d25920a87
3 changed files with 6 additions and 1 deletions

View File

@ -43,7 +43,7 @@ public class GatherNames {
} }
else{ else{
if(typeDecl.classDeclaration().normalClassDeclaration() != null){ if(typeDecl.classDeclaration().normalClassDeclaration() != null){
if(pkgName != ""){ if(!pkgName.isEmpty()){
nameString = pkgName + "." + typeDecl.classDeclaration().normalClassDeclaration().Identifier().toString(); nameString = pkgName + "." + typeDecl.classDeclaration().normalClassDeclaration().Identifier().toString();
} }
else{ else{

View File

@ -64,6 +64,10 @@ public class TypePlaceholder extends RefTypeOrTPHOrWildcardOrGeneric
} }
} }
@Override
public int hashCode() {
return this.getName().hashCode();
}
public String toString() public String toString()
{ {

View File

@ -114,6 +114,7 @@ public abstract class UnifyType {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj == null)return false;
return this.toString().equals(obj.toString()); return this.toString().equals(obj.toString());
} }
} }