Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix TemplateUtils usage #5010

Merged
merged 1 commit into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 160 String namespaceTmp = null , namespace is null here, stringBlankAndThenExecute is redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 160 String namespaceTmp = null , namespace is null here, stringBlankAndThenExecute is redundant


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();
}
}