diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java index 47229af85db2e..45af218cb4e83 100644 --- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java +++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java @@ -144,7 +144,9 @@ public Optional findEncryptor(final String logicTable, final S */ public List getEncryptValues(final String logicTable, final String logicColumn, final List originalValues) { Optional encryptor = findEncryptor(logicTable, logicColumn); - Preconditions.checkArgument(encryptor.isPresent(), String.format("Can not find QueryAssistedEncryptAlgorithm by %s.%s.", logicTable, logicColumn)); + if (!encryptor.isPresent()) { + throw new IllegalArgumentException(String.format("Can not find QueryAssistedEncryptAlgorithm by %s.%s.", logicTable, logicColumn)); + } return originalValues.stream().map(input -> null == input ? null : String.valueOf(encryptor.get().encrypt(input.toString()))).collect(Collectors.toList()); } diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/QuoteCharacter.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/QuoteCharacter.java index 90fe63a3214fe..aa53f0f69a53c 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/QuoteCharacter.java +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/constant/QuoteCharacter.java @@ -64,6 +64,6 @@ public static QuoteCharacter getQuoteCharacter(final String value) { * @return wrapped value */ public String wrap(final String value) { - return String.format("%s%s%s", startDelimiter, value, endDelimiter); + return startDelimiter + value + endDelimiter; } }