(Method method)
| 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() { |
no test coverage detected