未验证 提交 ee0a4391 编写于 作者: K kyoty 提交者: GitHub

[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
上级 ab3a88b6
......@@ -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, '.');
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册