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

Method equals

java/org/apache/tomcat/util/buf/MessageBytes.java:386–398  ·  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

384 * @return <code>true</code> if the comparison succeeded, <code>false</code> otherwise
385 */
386 public boolean equals(String s) {
387 return switch (type) {
388 case T_STR -> {
389 if (strValue == null) {
390 yield s == null;
391 }
392 yield strValue.equals(s);
393 }
394 case T_CHARS -> charC.equals(s);
395 case T_BYTES -> byteC.equals(s);
396 default -> false;
397 };
398 }
399
400 /**
401 * Compares the message bytes to the specified String object.

Callers 4

testEqualsNullNullMethod · 0.95
invokeMethod · 0.95
postParseRequestMethod · 0.95

Calls 3

isNullMethod · 0.95
equalsMethod · 0.65
isNullMethod · 0.65

Tested by 1

testEqualsNullNullMethod · 0.76