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

Method overridesObjectMethod

java/jakarta/el/ELContext.java:413–432  ·  view source on GitHub ↗
(Method method)

Source from the content-addressed store, hash-verified

411 * Copied from org.apache.el.lang.ELSupport - keep in sync
412 */
413 private static boolean overridesObjectMethod(Method method) {
414 // There are three methods that can be overridden
415 if ("equals".equals(method.getName())) {
416 if (method.getReturnType().equals(boolean.class)) {
417 if (method.getParameterCount() == 1) {
418 return method.getParameterTypes()[0].equals(Object.class);
419 }
420 }
421 } else if ("hashCode".equals(method.getName())) {
422 if (method.getReturnType().equals(int.class)) {
423 return method.getParameterCount() == 0;
424 }
425 } else if ("toString".equals(method.getName())) {
426 if (method.getReturnType().equals(String.class)) {
427 return method.getParameterCount() == 0;
428 }
429 }
430
431 return false;
432 }
433}

Callers 1

isFunctionalInterfaceMethod · 0.95

Calls 5

getParameterCountMethod · 0.80
equalsMethod · 0.65
getNameMethod · 0.65
getReturnTypeMethod · 0.45
getParameterTypesMethod · 0.45

Tested by

no test coverage detected