Comment From: zhangyuanchao

In the method, mapperInterface and declaringClass are the same interface, and method mapperInterface.getInterfaces() returns the all super interfaces of current interface. But for the method isAssignableFrom, subInterface.class.isAssignableFrom(superInterface.class) returns false, that is to say, the if statement is never executed.

Comment From: harawata

Hello @zhangyuanchao ,

When you suspect something like this, you should confirm your theory by removing the lines inside the if statement ...

https://github.com/mybatis/mybatis-3/blob/edc7be7e0c5f05efea0230bf3b45e58c9b4d5b95/src/main/java/org/apache/ibatis/binding/MapperMethod.java#L264-L268

... and running the tests.

./mvnw clean verify 

If there is no test failure, you might be right.

In this case, two tests in MapperExtendTest will fail and that means the if condition can be true. By reading/debugging the failed tests, you may learn the reason.

Please let me know if I am misunderstanding something.