MCPcopy Create free account
hub / github.com/apache/tomcat / equalsIgnoreCase

Method equalsIgnoreCase

java/org/apache/tomcat/util/buf/CharChunk.java:501–521  ·  view source on GitHub ↗

Compares the message bytes to the specified String object. @param s the String to compare @return true if the comparison succeeded, false otherwise

(String s)

Source from the content-addressed store, hash-verified

499 * @return <code>true</code> if the comparison succeeded, <code>false</code> otherwise
500 */
501 public boolean equalsIgnoreCase(String s) {
502 char[] c = buff;
503 int len = end - start;
504 if (c == null || len != s.length()) {
505 return false;
506 }
507 int off = start;
508 for (int i = 0; i < len; i++) {
509 char c1 = c[off++];
510 char c2 = s.charAt(i);
511 // Use ASCII short-cut if possible
512 if (c1 > 0xFF || c2 > 0xFF) {
513 if (Character.toLowerCase(c1) != Character.toLowerCase(c2)) {
514 return false;
515 }
516 } else if (Ascii.toLower(c1) != Ascii.toLower(c2)) {
517 return false;
518 }
519 }
520 return true;
521 }
522
523
524 /**

Callers 15

TomcatSecurityServiceMethod · 0.45
parsePoolPropertiesMethod · 0.45
processRequestMethod · 0.45
setActionMethod · 0.45
getHintMethod · 0.45
getSuccessMethod · 0.45
setToBrowserMethod · 0.45
doGetMethod · 0.45
validateHeaderMethod · 0.45
getHeaderMethod · 0.45

Calls 3

toLowerMethod · 0.95
lengthMethod · 0.80
charAtMethod · 0.80

Tested by 11

doGetMethod · 0.36
validateHeaderMethod · 0.36
getHeaderMethod · 0.36
testTimeoutGets408Method · 0.36
getInitParameterMethod · 0.36
validateMethod · 0.36
testBug63909Method · 0.36
waitForInputMethod · 0.36