Browse Source

[Improvement] the automatically generated spi service name in alert-plugin is wrong (#5676)

* bug fix

the auto generated spi service can't be recongized



* include a  new method
2.0.7-release
kyoty 4 years ago committed by GitHub
parent
commit
ee0a4391e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/plugin/DolphinPluginDiscovery.java

6
dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/plugin/DolphinPluginDiscovery.java

@ -105,7 +105,7 @@ final class DolphinPluginDiscovery {
public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) {
if (file.getFileName().toString().endsWith(JAVA_CLASS_FILE_SUFFIX)) {
String name = file.subpath(base.getNameCount(), file.getNameCount()).toString();
list.add(javaName(name.substring(0, name.length() - JAVA_CLASS_FILE_SUFFIX.length())));
list.add(convertClassName(name.substring(0, name.length() - JAVA_CLASS_FILE_SUFFIX.length())));
}
return FileVisitResult.CONTINUE;
}
@ -143,4 +143,8 @@ final class DolphinPluginDiscovery {
private static String javaName(String binaryName) {
return binaryName.replace('/', '.');
}
private static String convertClassName(String pathName) {
return pathName.replace(File.separatorChar, '.');
}
}

Loading…
Cancel
Save