|
@@ -24,7 +24,6 @@ import java.lang.invoke.MethodHandles;
|
|
|
import java.lang.reflect.Constructor;
|
|
|
import java.lang.reflect.InvocationHandler;
|
|
|
import java.lang.reflect.Method;
|
|
|
-import java.lang.reflect.Modifier;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@@ -52,7 +51,7 @@ public class MybatisMapperProxy<T> implements InvocationHandler, Serializable {
|
|
|
try {
|
|
|
if (Object.class.equals(method.getDeclaringClass())) {
|
|
|
return method.invoke(this, args);
|
|
|
- } else if (isDefaultMethod(method)) {
|
|
|
+ } else if (method.isDefault()) {
|
|
|
return invokeDefaultMethod(proxy, method, args);
|
|
|
}
|
|
|
} catch (Throwable t) {
|
|
@@ -80,13 +79,4 @@ public class MybatisMapperProxy<T> implements InvocationHandler, Serializable {
|
|
|
| MethodHandles.Lookup.PACKAGE | MethodHandles.Lookup.PUBLIC)
|
|
|
.unreflectSpecial(method, declaringClass).bindTo(proxy).invokeWithArguments(args);
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * Backport of java.lang.reflect.Method#isDefault()
|
|
|
- */
|
|
|
- private boolean isDefaultMethod(Method method) {
|
|
|
- return (method.getModifiers()
|
|
|
- & (Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC)) == Modifier.PUBLIC
|
|
|
- && method.getDeclaringClass().isInterface();
|
|
|
- }
|
|
|
}
|