You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by wu...@apache.org on 2022/12/22 12:47:57 UTC

[shardingsphere-elasticjob] branch master updated: fix conflict job class check error (#2167)

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

wuweijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob.git


The following commit(s) were added to refs/heads/master by this push:
     new 642c8c909 fix conflict job class check error (#2167)
642c8c909 is described below

commit 642c8c909015b405c4e276de272b3d873af2922e
Author: songxiulu <cn...@163.com>
AuthorDate: Thu Dec 22 20:47:47 2022 +0800

    fix conflict job class check error (#2167)
    
    Co-authored-by: songxiulu <so...@jd.com>
---
 .../elasticjob/lite/internal/config/ConfigurationService.java          | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java
index 07eade08b..8b89be15d 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.elasticjob.lite.internal.config;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
 import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException;
 import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException;
@@ -85,7 +86,7 @@ public final class ConfigurationService {
             return;
         }
         String originalJobClassName = jobNodeStorage.getJobRootNodeData();
-        if (null != originalJobClassName && !originalJobClassName.equals(newJobClassName)) {
+        if (StringUtils.isNotBlank(originalJobClassName) && !originalJobClassName.equals(newJobClassName)) {
             throw new JobConfigurationException(
                     "Job conflict with register center. The job '%s' in register center's class is '%s', your job class is '%s'", jobConfig.getJobName(), originalJobClassName, newJobClassName);
         }