Skip to content

Commit

Permalink
Refactor YamlGlobalClockRuleConfigurationSwapper (#32929)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Sep 19, 2024
1 parent 52898a3 commit 366ea48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class YamlGlobalClockRuleConfiguration implements YamlGlobalRuleCon

private boolean enabled;

private Properties props;
private Properties props = new Properties();

@Override
public Class<GlobalClockRuleConfiguration> getRuleConfigurationType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import org.apache.shardingsphere.globalclock.yaml.config.YamlGlobalClockRuleConfiguration;
import org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper;

import java.util.Properties;

/**
* YAML global clock rule configuration swapper.
*/
Expand All @@ -41,7 +39,7 @@ public YamlGlobalClockRuleConfiguration swapToYamlConfiguration(final GlobalCloc

@Override
public GlobalClockRuleConfiguration swapToObject(final YamlGlobalClockRuleConfiguration yamlConfig) {
return new GlobalClockRuleConfiguration(yamlConfig.getType(), yamlConfig.getProvider(), yamlConfig.isEnabled(), null == yamlConfig.getProps() ? new Properties() : yamlConfig.getProps());
return new GlobalClockRuleConfiguration(yamlConfig.getType(), yamlConfig.getProvider(), yamlConfig.isEnabled(), yamlConfig.getProps());
}

@Override
Expand Down

0 comments on commit 366ea48

Please sign in to comment.