Compares the specified object to this string and returns true if they are equal. The object must be an instance of string with the same characters in the same order. @param object the object to compare. @return true if the specified object is equal to this string, {@code
(Object object)
| 759 | * @see #hashCode |
| 760 | */ |
| 761 | @Override |
| 762 | public boolean equals(Object object) { |
| 763 | if (object == this) { |
| 764 | return true; |
| 765 | } |
| 766 | if (object instanceof String) { |
| 767 | String s = (String) object; |
| 768 | int hash = hashCode; // Single read on hashCodes as they may change |
| 769 | int shash = s.hashCode; |
| 770 | if (count != s.count || (hash != shash && hash != 0 && shash != 0)) { |
| 771 | return false; |
| 772 | } |
| 773 | for (int i = 0; i < count; ++i) { |
| 774 | if (value[offset + i] != s.value[s.offset + i]) { |
| 775 | return false; |
| 776 | } |
| 777 | } |
| 778 | return true; |
| 779 | } |
| 780 | return false; |
| 781 | } |
| 782 | |
| 783 | /** |
| 784 | * Compares the specified string to this string ignoring the case of the |
no outgoing calls
no test coverage detected