-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Cleanup #17801
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
Cleanup #17801
Conversation
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String result = (query == null) ? "" : artifactPattern.matcher(query).replaceFirst("");
if (result.isEmpty()) {
return null;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot be null and cannot be an empty String -> Cannot be null or empty String
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there are several uses of str == null || str.isEmpty()
I think a common util function will be helpful
boolean isEmpty(String str) {
return str == null || str.length == 0;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use !org.springframework.util.StringUtils#hasLength
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
ec9b7b9
to
f77e0b9
Compare
Uh oh!
There was an error while loading. Please reload this page.
This PR includes
StringUtils#hasLength