Repository: apache/dubbo
File: dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/metadata/ConfigurableMetadataServiceExporter.java (Java)

Code before:
    public synchronized ConfigurableMetadataServiceExporter export() {
        if ((serviceConfig == null && serviceConfigV2 == null) || !isExported()) {
            if (MetadataServiceVersionUtils.needExportV1(applicationModel)) {
                exportV1();
            }
            if (MetadataServiceVersionUtils.needExportV2(applicationModel)) {
                exportV2();
            }
        } else {
            if (logger.isWarnEnabled()) {
                logger.warn(
                        CONFIG_METADATA_SERVICE_EXPORTED,
                        "",
                        "",
                        "The MetadataService has been exported : " + getExportedUrls());
            }
        }

        return this;
    }

    public List<URL> getExportedUrls() {
        List<URL> urls = new ArrayList<>();
        if (serviceConfig != null) {
            urls.addAll(serviceConfig.getExportedUrls());
        }
        if (serviceConfigV2 != null) {
            urls.addAll(serviceConfigV2.getExportedUrls());
        }
        return urls;
    }

    private static final String INTERNAL_METADATA_REGISTRY_ID = "internal-metadata-registry";

    private void exportV1() {
        ExecutorService internalServiceExecutor = applicationModel
                .getFrameworkModel()
                .getBeanFactory()
                .getBean(FrameworkExecutorRepository.class)
                .getInternalServiceExecutor();
        this.serviceConfig = InternalServiceConfigBuilder.<MetadataService>newBuilder(applicationModel)
                .interfaceClass(MetadataService.class)
                .protocol(getApplicationConfig().getMetadataServiceProtocol(), METADATA_SERVICE_PROTOCOL_KEY)
                .port(getApplicationConfig().getMetadataServicePort(), METADATA_SERVICE_PORT_KEY)
                .registryId(INTERNAL_METADATA_REGISTRY_ID)
                .executor(internalServiceExecutor)
                .ref(metadataService)
                .version(V1)
                .build(configConsumer -> configConsumer.setMethods(generateMethodConfig()));

        serviceConfig.export();

Review comment (suggestion):
The new public method `getExportedUrls()` lacks documentation. Consider adding a Javadoc comment explaining its purpose and return value.

Code after:
    public synchronized ConfigurableMetadataServiceExporter export() {
        if (!isExported()) {
            if (MetadataServiceVersionUtils.needExportV1(applicationModel)) {
                exportV1();
            }
            if (MetadataServiceVersionUtils.needExportV2(applicationModel)) {
                exportV2();
            }
        } else {
            if (logger.isWarnEnabled()) {
                logger.warn(
                        CONFIG_METADATA_SERVICE_EXPORTED,
                        "",
                        "",
                        "The MetadataService has been exported : " + getExportedUrls());
            }
        }

        return this;
    }

    /**
     * Get exported urls which include v1 and v2 if existed
     * @return exported urls
     */
    public List<URL> getExportedUrls() {
        List<URL> urls = new ArrayList<>();
        if (serviceConfig != null) {
            urls.addAll(serviceConfig.getExportedUrls());
        }
        if (serviceConfigV2 != null) {
            urls.addAll(serviceConfigV2.getExportedUrls());
        }
        return urls;
    }

    private static final String INTERNAL_METADATA_REGISTRY_ID = "internal-metadata-registry";

    private void exportV1() {
        ExecutorService internalServiceExecutor = applicationModel
                .getFrameworkModel()
                .getBeanFactory()
                .getBean(FrameworkExecutorRepository.class)
                .getInternalServiceExecutor();
        this.serviceConfig = InternalServiceConfigBuilder.<MetadataService>newBuilder(applicationModel)
                .interfaceClass(MetadataService.class)
                .protocol(getApplicationConfig().getMetadataServiceProtocol(), METADATA_SERVICE_PROTOCOL_KEY)
                .port(getApplicationConfig().getMetadataServicePort(), METADATA_SERVICE_PORT_KEY)
                .registryId(INTERNAL_METADATA_REGISTRY_ID)
                .executor(internalServiceExecutor)
                .ref(metadataService)