### Environment

* Dubbo version: 2.7.3
* Operating System version: CentOS7
* Java version: 1.8

### Steps to reproduce this issue

1. Set two protocal, with different "register" attribute

```xml
<dubbo:protocol name="dubbo" port="8751" register="true"  />
<dubbo:protocol name="hessian" port="8752" register="false" />
```

2. use the zookeeper registry center

```xml
<dubbo:registry address="..." file="./.dubbo_cache" />
```

3. start the server and view the provider in zkCli


### Expected Result
only the dubbo is registed

### Actual Result
the dubbo and hession protocol are registed

}
            checkInterfaceAndMethods(interfaceClass, methods);
            checkRef();
            generic = Boolean.FALSE.toString();
        }
        if (local != null) {
            if (Boolean.TRUE.toString().equals(local)) {
                local = interfaceName + "Local";
            }
            Class<?> localClass;
            try {
                localClass = ClassUtils.forNameWithThreadContextClassLoader(local);
            } catch (ClassNotFoundException e) {
                throw new IllegalStateException(e.getMessage(), e);
            }
            if (!interfaceClass.isAssignableFrom(localClass)) {
                throw new IllegalStateException("The local implementation class " + localClass.getName() + " not implement interface " + interfaceName);
            }
        }
        if (stub != null) {
            if (Boolean.TRUE.toString().equals(stub)) {
                stub = interfaceName + "Stub";
            }
            Class<?> stubClass;
            try {
                stubClass = ClassUtils.forNameWithThreadContextClassLoader(stub);
            } catch (ClassNotFoundException e) {
                throw new IllegalStateException(e.getMessage(), e);
            }
            if (!interfaceClass.isAssignableFrom(stubClass)) {