MCPcopy Index your code
hub / github.com/davidgiven/luje / equals

Method equals

lib/java/lang/String.java:761–781  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 5

equalsMethod · 0.95
checkURIMethod · 0.95
parseAuthorityMethod · 0.95
isValidDomainNameMethod · 0.95
relativizeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected