```java
private Class<?> resolveServiceInterfaceClass(Class<?> 
annotatedServiceBeanClass, Service service) {

        Class<?> interfaceClass = service.interfaceClass();

        if (void.class.equals(interfaceClass)) {

            interfaceClass = null;

            String interfaceClassName = service.interfaceName();

            if (StringUtils.hasText(interfaceClassName)) {
                if (ClassUtils.isPresent(interfaceClassName, classLoader)) {
                    interfaceClass = resolveClassName(interfaceClassName, 
classLoader);
                }
            }

        }

        if (interfaceClass == null) {

            Class<?>[] allInterfaces = 
annotatedServiceBeanClass.getInterfaces();

            if (allInterfaces.length > 0) {
                interfaceClass = allInterfaces[0];
            }

        }

        Assert.notNull(interfaceClass,
                "@Service interfaceClass() or interfaceName() or interface 
class must be present!");

        Assert.isTrue(interfaceClass.isInterface(),
                "The type that was annotated @Service is not an interface!");

        return interfaceClass;
    }
```
Read this method in ServiceAnnotationBeanPostProcessor.java .
If you do not set the interfaceClass of @Service annotation obviously, the 
method will just find the interfaces that the class declare by itself, but it 
will not search the interfaces that its super classes declares.
I think it is not a bug, it can be regarded as a simpler design because the a 
class may have many hierarchies of super classes so searching the interfaces of 
its super classes recursively may be too heavy.

[ Full content available at: 
https://github.com/apache/incubator-dubbo/issues/3251 ]
This message was relayed via gitbox.apache.org for 
[email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to