Skip to content

Instantly share code, notes, and snippets.

@ntub46010
Created January 26, 2022 08:00
Show Gist options
  • Save ntub46010/41d1f331b1cbc78cdbaa300b00658eb1 to your computer and use it in GitHub Desktop.
Save ntub46010/41d1f331b1cbc78cdbaa300b00658eb1 to your computer and use it in GitHub Desktop.
public boolean equals(Object anObject) {
if (this == anObject) {
return true;
}
if (anObject instanceof String) {
String aString = (String)anObject;
if (coder() == aString.coder()) {
return isLatin1() ? StringLatin1.equals(value, aString.value)
: StringUTF16.equals(value, aString.value);
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment