dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

resolvePackagesToScan modify function

Open wangkeguo opened this issue 1 year ago • 2 comments

Pre-check

  • [X] I am sure that all the content I provide is in English.

Search before asking

  • [X] I had searched in the issues and found no similar feature requirement.

Apache Dubbo Component

Java SDK (apache/dubbo)

Descriptions

I hope to modify the resolvePackagesToScan function in the ServiceAnnotationPostProcessor class information to

private Set<String> resolvePackagesToScan(Set<String> packagesToScan) {
    Set<String> resolvedPackagesToScan = new LinkedHashSet<>(packagesToScan.size());
    for (String packageToScan : packagesToScan) {
        if (StringUtils.hasText(packageToScan)) {
            String resolvedPackageToScan = environment.resolvePlaceholders(packageToScan.trim());
            resolvedPackageToScan=resolvedPackageToScan.replace(",",";");
            resolvedPackageToScan=resolvedPackageToScan.replace("\t",";");
            resolvedPackagesToScan.addAll(Arrays.asList(resolvedPackageToScan.split(";")));
        }
    }
    return resolvedPackagesToScan;
}

Related issues

No response

Are you willing to submit a pull request to fix on your own?

  • [X] Yes I am willing to submit a pull request on my own!

Code of Conduct

wangkeguo avatar Mar 20 '24 03:03 wangkeguo

Why? packagesToScan is a collection now.

AlbumenJ avatar Mar 21 '24 08:03 AlbumenJ

Why? packagesToScan is a collection now.

I think, he want to resolve the special characters.

lingmeme avatar May 22 '24 11:05 lingmeme