vran-dev opened a new issue #1496:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1496


   
   
   If  param  `elasticJob` is null, the following `JobScheduler` contructor 
will throw **JobConfigurationException:  Can not find executor for elastic job 
type `null`**
   
   ```java
   // at line 78
   public JobScheduler(final CoordinatorRegistryCenter regCenter,
                       final ElasticJob elasticJob,
                       final JobConfiguration jobConfig,
                       final TracingConfiguration<?> tracingConfig,
                       final ElasticJobListener... elasticJobListeners)
   ```
   
   this constructor don't care param `String elasticJobType`, so the error 
message  make user confusing. 
   
   It's caused by the following code segment
   
   ```java
   // at line 78
   public JobScheduler(...) {
       // in this constructor,  elasticJobType is always null
       elasticJobType = null; // at line 82
       // elasticJob is null, will call `ElasticJobExecutor` constructor, then 
throw JobConfigurationException
       jobExecutor = null == elasticJob ? new 
ElasticJobExecutor(elasticJobType, jobConfig, jobFacade) : new 
ElasticJobExecutor(elasticJob, jobConfig, jobFacade); // at line 87
   }
   ```
   
   so, i think
   
   - should do Pre-check for param `elasticJob`
   - give more clearly error message
   
   could i improve it ?


----------------------------------------------------------------
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.

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


Reply via email to