You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ki...@apache.org on 2021/06/29 16:32:54 UTC

[dolphinscheduler] branch dev updated: [Improvement] the automatically generated spi service name in alert-plugin is wrong (#5676)

This is an automated email from the ASF dual-hosted git repository.

kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new ee0a439  [Improvement] the automatically generated spi service name in alert-plugin is wrong (#5676)
ee0a439 is described below

commit ee0a4391e7a21ef7773eba015fa783ff616ac4a6
Author: kyoty <ec...@gmail.com>
AuthorDate: Wed Jun 30 00:32:44 2021 +0800

    [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
---
 .../apache/dolphinscheduler/spi/plugin/DolphinPluginDiscovery.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/plugin/DolphinPluginDiscovery.java b/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/plugin/DolphinPluginDiscovery.java
index b533513..c09bf71 100644
--- a/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/plugin/DolphinPluginDiscovery.java
+++ b/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, '.');
+    }
 }