Skip to content

Commit

Permalink
fix TemplateUtils usage (alibaba#5010)
Browse files Browse the repository at this point in the history
  • Loading branch information
shalk committed Mar 5, 2021
1 parent 96de278 commit 63f7e33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,7 @@ public static String parseNamespace(Properties properties) {
String.valueOf(Constants.DEFAULT_USE_CLOUD_NAMESPACE_PARSING)));

if (Boolean.parseBoolean(isUseCloudNamespaceParsing)) {
namespaceTmp = TemplateUtils.stringBlankAndThenExecute(namespaceTmp, new Callable<String>() {
@Override
public String call() {
return TenantUtil.getUserTenantForAcm();
}
});
namespaceTmp = TenantUtil.getUserTenantForAcm();

namespaceTmp = TemplateUtils.stringBlankAndThenExecute(namespaceTmp, new Callable<String>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static String stringEmptyAndThenExecute(String source, Callable<String> c
}
}

return source.trim();
return source == null ? null : source.trim();
}

/**
Expand All @@ -85,6 +85,6 @@ public static String stringBlankAndThenExecute(String source, Callable<String> c
}
}

return source.trim();
return source == null ? null : source.trim();
}
}

0 comments on commit 63f7e33

Please sign in to comment.