RaigorJiang commented on a change in pull request #15635:
URL: https://github.com/apache/shardingsphere/pull/15635#discussion_r814657436
##########
File path:
shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/update/DropEncryptRuleStatementUpdater.java
##########
@@ -68,10 +68,12 @@ public boolean updateCurrentRuleConfiguration(final
DropEncryptRuleStatement sql
private void dropRule(final EncryptRuleConfiguration currentRuleConfig,
final String ruleName) {
Optional<EncryptTableRuleConfiguration> encryptTableRuleConfig =
currentRuleConfig.getTables().stream().filter(tableRule ->
tableRule.getName().equals(ruleName)).findAny();
- Preconditions.checkState(encryptTableRuleConfig.isPresent());
- currentRuleConfig.getTables().remove(encryptTableRuleConfig.get());
- encryptTableRuleConfig.get().getColumns().stream().filter(column ->
!isEncryptorInUse(currentRuleConfig, column.getEncryptorName()))
- .forEach(column ->
currentRuleConfig.getEncryptors().remove(column.getEncryptorName()));
+ encryptTableRuleConfig.ifPresent(op -> {
+ currentRuleConfig.getTables().remove(encryptTableRuleConfig.get());
+ encryptTableRuleConfig.get().getColumns().stream().filter(column
-> !isEncryptorInUse(currentRuleConfig, column.getEncryptorName()))
+ .forEach(column ->
currentRuleConfig.getEncryptors().remove(column.getEncryptorName()));
+
Review comment:
Blank line.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]