Pace2Car commented on code in PR #25041:
URL: https://github.com/apache/shardingsphere/pull/25041#discussion_r1191856584
##########
features/mask/core/src/main/java/org/apache/shardingsphere/mask/algorithm/replace/PersonalIdentityNumberRandomReplaceAlgorithm.java:
##########
@@ -37,6 +39,8 @@ public final class
PersonalIdentityNumberRandomReplaceAlgorithm implements MaskA
@Override
public void init(final Properties props) {
+
ShardingSpherePreconditions.checkState(props.containsKey(ALPHA_TWO_COUNTRY_AREA_CODE),
Review Comment:
I recommend checking like this
```java
@Override
public void init(final Properties props) {
alphaTwoCountryAreaCode = props.getProperty(ALPHA_TWO_COUNTRY_AREA_CODE,
"CN");
ShardingSpherePreconditions.checkState(!Strings.isNullOrEmpty(alphaTwoCountryAreaCode),
() -> new MaskAlgorithmInitializationException(getType(),
String.format("%s can not be empty", ALPHA_TWO_COUNTRY_AREA_CODE)));
}
```
--
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]