mirror of
https://github.com/revanced/smali.git
synced 2025-05-03 16:14:29 +02:00
Fix implementation of equals for BaseTypeReference
This fixes the implementation so it matches what is described in the documentation for the TypeReference interface. Specifically, it allows for comparison to a CharSequence
This commit is contained in:
parent
36b6a31685
commit
dda097947f
@ -43,9 +43,14 @@ public abstract class BaseTypeReference implements TypeReference {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (o != null && o instanceof TypeReference) {
|
if (o != null) {
|
||||||
|
if (o instanceof TypeReference) {
|
||||||
return getType().equals(((TypeReference)o).getType());
|
return getType().equals(((TypeReference)o).getType());
|
||||||
}
|
}
|
||||||
|
if (o instanceof CharSequence) {
|
||||||
|
return getType().equals(o.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ public interface TypeReference extends Reference, CharSequence, Comparable<CharS
|
|||||||
/**
|
/**
|
||||||
* Compares this TypeReference to another TypeReference, or more generally to another CharSequence for equality.
|
* Compares this TypeReference to another TypeReference, or more generally to another CharSequence for equality.
|
||||||
*
|
*
|
||||||
* This TypeReference is equal to a CharSequence iff this.getType().equals(other.getString()).
|
* This TypeReference is equal to a CharSequence iff this.getType().equals(other.toString()).
|
||||||
*
|
*
|
||||||
* Equivalently, This TypeReference is equal to another TypeReference iff this.getType().equals(other.getType()).
|
* Equivalently, This TypeReference is equal to another TypeReference iff this.getType().equals(other.getType()).
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user