kyoty opened a new issue #5710:
URL: https://github.com/apache/dolphinscheduler/issues/5710


   
   The usage of Preconditions.checkState in Guava is wrong, the placeholder 
should use the form of %s instead of {}
   like this: 
[DolphinPluginLoader.java#L107](https://github.com/apache/dolphinscheduler/blob/3d8d1ebe67cc3331ff5fda649675b5c61a04df5f/dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/plugin/DolphinPluginLoader.java#L107)
   ```java
   private void loadPlugin(URLClassLoader pluginClassLoader) {
           ServiceLoader<DolphinSchedulerPlugin> serviceLoader = 
ServiceLoader.load(DolphinSchedulerPlugin.class, pluginClassLoader);
           List<DolphinSchedulerPlugin> plugins = 
ImmutableList.copyOf(serviceLoader);
           Preconditions.checkState(!plugins.isEmpty(), "No service providers 
the plugin {}",DolphinSchedulerPlugin.class.getName());
           for (DolphinSchedulerPlugin plugin : plugins) {
               logger.info("Installing {}", plugin.getClass().getName());
               for (AbstractDolphinPluginManager dolphinPluginManager : 
dolphinPluginManagerList) {
                   dolphinPluginManager.installPlugin(plugin);
               }
           }
       }
   ```
   we can reproduce this like this simple sample:
   ```java
   public class Test {
       public static void main(String[] args) {
           String word = "letters";
           checkState(word.isEmpty(), "Alert Plugin {} is not null", word);
       }
   }
   ```
   the result is:
   **Alert Plugin {} is not null [letters]**
   but we actually want to show the message like this:
   **Alert Plugin letters is not null**


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to