branch : master , version : 2.7.0-SNAPSHOT
ServiceConfig#doExportUrlsFor1Protocol , line 482

<img width="890" alt="image" src="https://user-images.githubusercontent.com/6971152/41273922-035827c2-6e4e-11e8-8a72-71562d138cf9.png">

The type of Constant.SCOPE_Xxx is String already , no need to call toString() again
if (hostToRegistry != null && hostToRegistry.length() > 0 && isInvalidLocalHost(hostToRegistry)) {
            throw new IllegalArgumentException("Specified invalid registry ip from property:" + Constants.DUBBO_IP_TO_REGISTRY + ", value:" + hostToRegistry);
        } else if (hostToRegistry == null || hostToRegistry.length() == 0) {
            
            hostToRegistry = hostToBind;
        }
        map.put(Constants.ANYHOST_KEY, String.valueOf(anyhost));
        return hostToRegistry;
    }
    /**
     * Register port and bind port for the provider, can be configured separately
     * Configuration priority: environment variable -> java system properties -> port property in protocol config file
     * -> protocol default port
     *
     * @param protocolConfig
     * @param name
     * @return
     */
    private Integer findConfigedPorts(ProtocolConfig protocolConfig, String name, Map<String, String> map) {
        Integer portToBind = null;
        
        String port = getValueFromConfig(protocolConfig, Constants.DUBBO_PORT_TO_BIND);
        portToBind = parsePort(port);
        
        if (portToBind == null) {
            portToBind = protocolConfig.getPort();
            if (provider != null && (portToBind == null || portToBind == 0)) {
                portToBind = provider.getPort();
            }
            final int defaultPort = ExtensionLoader.getExtensionLoader(Protocol.class).getExtension(name).getDefaultPort();