MCPcopy Index your code
hub / github.com/apache/tomcat / overridesObjectMethod

Method overridesObjectMethod

java/org/apache/el/lang/ELSupport.java:793–816  ·  view source on GitHub ↗
(Method method)

Source from the content-addressed store, hash-verified

791 * Copied to jakarta.el.ELContext - keep in sync
792 */
793 private static boolean overridesObjectMethod(Method method) {
794 // There are three methods that can be overridden
795 switch (method.getName()) {
796 case "equals" -> {
797 if (method.getReturnType().equals(boolean.class)) {
798 if (method.getParameterCount() == 1) {
799 return method.getParameterTypes()[0].equals(Object.class);
800 }
801 }
802 }
803 case "hashCode" -> {
804 if (method.getReturnType().equals(int.class)) {
805 return method.getParameterCount() == 0;
806 }
807 }
808 case "toString" -> {
809 if (method.getReturnType().equals(String.class)) {
810 return method.getParameterCount() == 0;
811 }
812 }
813 }
814
815 return false;
816 }
817
818
819 private ELSupport() {

Callers 1

isFunctionalInterfaceMethod · 0.95

Calls 5

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

Tested by

no test coverage detected