TeslaCN commented on a change in pull request #1552:
URL:
https://github.com/apache/shardingsphere-elasticjob/pull/1552#discussion_r503248310
##########
File path:
elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProvider.java
##########
@@ -22,10 +22,20 @@
/**
* Simple job class name provider.
*/
-public final class SimpleJobClassNameProvider implements JobClassNameProvider {
+public final class DefaultJobClassNameProvider implements JobClassNameProvider
{
@Override
public String getJobClassName(final ElasticJob elasticJob) {
- return elasticJob.getClass().getName();
+ Class<? extends ElasticJob> elasticJobClass = elasticJob.getClass();
+ String elasticJobClassName = elasticJobClass.getName();
+ return isLambdaClass(elasticJobClass) ?
trimLambdaClassSuffix(elasticJobClassName) : elasticJobClassName;
+ }
+
+ private boolean isLambdaClass(final Class<? extends ElasticJob>
elasticJobClass) {
Review comment:
Testcase will be committed in a new PR.
----------------------------------------------------------------
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]