8060485: (str) contentEquals checks the String contents twice on mismatch

Reviewed-by: martin, chegar, alanb
This commit is contained in:
Aleksey Shipilev 2014-10-14 19:35:03 +02:00
parent aa48d0f22b
commit c25af2a638

View File

@ -1045,8 +1045,9 @@ public final class String
}
}
// Argument is a String
if (cs.equals(this))
return true;
if (cs instanceof String) {
return equals(cs);
}
// Argument is a generic CharSequence
char v1[] = value;
int n = v1.length;