Skip to content

Commit

Permalink
fix parentChildEmptyNullConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Yingjian Wu committed Oct 28, 2024
1 parent 1aada77 commit 0be8524
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ public ParentChildRelationshipProperties(@Nullable final Environment env) {
* @param configStr configString
*/
public void setMaxAllowPerTablePerRelType(@Nullable final String configStr) {
if (configStr == null || configStr.isEmpty()) {
return;
}
try {
this.maxAllowPerTablePerRelType = parseNestedConfigString(configStr);
this.maxAllowPerTablePerRelType = configStr == null || configStr.isEmpty()
? new HashMap<>() : parseNestedConfigString(configStr);
} catch (Exception e) {
log.error("Fail to apply configStr = {} for maxAllowPerTablePerRelType", configStr, e);
}
Expand All @@ -74,11 +72,9 @@ public void setMaxAllowPerTablePerRelType(@Nullable final String configStr) {
* @param configStr configString
*/
public void setMaxAllowPerDBPerRelType(@Nullable final String configStr) {
if (configStr == null || configStr.isEmpty()) {
return;
}
try {
this.maxAllowPerDBPerRelType = parseNestedConfigString(configStr);
this.maxAllowPerDBPerRelType = configStr == null || configStr.isEmpty()
? new HashMap<>() : parseNestedConfigString(configStr);
} catch (Exception e) {
log.error("Fail to apply configStr = {} for maxCloneAllowPerDBPerRelType", configStr);
}
Expand All @@ -89,11 +85,9 @@ public void setMaxAllowPerDBPerRelType(@Nullable final String configStr) {
* @param configStr configString
*/
public void setDefaultMaxAllowPerRelType(@Nullable final String configStr) {
if (configStr == null || configStr.isEmpty()) {
return;
}
try {
this.defaultMaxAllowPerRelType =
this.defaultMaxAllowPerRelType = configStr == null || configStr.isEmpty() ?
new HashMap<>() :
Arrays.stream(configStr.split(";"))
.map(entry -> entry.split(","))
.collect(Collectors.toMap(
Expand Down

0 comments on commit 0be8524

Please sign in to comment.