(MetaMethod method, MetaMethod newMethod, Class instanceKlazz)
| 4051 | } |
| 4052 | |
| 4053 | private static MetaMethod mostSpecific(MetaMethod method, MetaMethod newMethod, Class instanceKlazz) { |
| 4054 | Class<?> newMethodC = newMethod.getDeclaringClass().getTheClass(); |
| 4055 | if (!newMethodC.isAssignableFrom(instanceKlazz)) { |
| 4056 | return method; |
| 4057 | } |
| 4058 | Class<?> methodC = method.getDeclaringClass().getTheClass(); |
| 4059 | if (newMethodC == methodC) { |
| 4060 | return newMethod; |
| 4061 | } |
| 4062 | if (newMethodC.isAssignableFrom(methodC)) { |
| 4063 | return method; |
| 4064 | } |
| 4065 | if (methodC.isAssignableFrom(newMethodC)) { |
| 4066 | return newMethod; |
| 4067 | } |
| 4068 | return newMethod; |
| 4069 | } |
| 4070 | |
| 4071 | /** |
| 4072 | * Chooses the best method declared directly on the supplied meta class. |
no test coverage detected