Skip to content

Commit

Permalink
Code format for DropEncryptRuleExecutor (#34014)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Dec 11, 2024
1 parent 956bfb8 commit c43e2b1
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public boolean hasAnyOneToBeDropped(final DropEncryptRuleStatement sqlStatement)
@Override
public EncryptRuleConfiguration buildToBeDroppedRuleConfiguration(final DropEncryptRuleStatement sqlStatement) {
Collection<EncryptTableRuleConfiguration> toBeDroppedTables = new LinkedList<>();
Map<String, AlgorithmConfiguration> toBeDroppedEncryptors = new HashMap<>();
Map<String, AlgorithmConfiguration> toBeDroppedEncryptors = new HashMap<>(sqlStatement.getTables().size(), 1F);
for (String each : sqlStatement.getTables()) {
toBeDroppedTables.add(new EncryptTableRuleConfiguration(each, Collections.emptyList()));
dropRule(each);
Expand All @@ -78,8 +78,7 @@ public EncryptRuleConfiguration buildToBeDroppedRuleConfiguration(final DropEncr
}

private void dropRule(final String ruleName) {
Optional<EncryptTableRuleConfiguration> encryptTableRuleConfig = rule.getConfiguration().getTables().stream()
.filter(each -> each.getName().equalsIgnoreCase(ruleName)).findAny();
Optional<EncryptTableRuleConfiguration> encryptTableRuleConfig = rule.getConfiguration().getTables().stream().filter(each -> each.getName().equalsIgnoreCase(ruleName)).findAny();
encryptTableRuleConfig.ifPresent(optional -> rule.getConfiguration().getTables().remove(encryptTableRuleConfig.get()));
}

Expand Down

0 comments on commit c43e2b1

Please sign in to comment.