reta commented on a change in pull request #501: cxf-core: use
String.isEmpty(); remove duplicate
URL: https://github.com/apache/cxf/pull/501#discussion_r248520018
##########
File path: core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
##########
@@ -85,13 +86,8 @@ public static String getSharedPackageName(List<Class<?>>
classes) {
}
public static String parsePackageName(String namespace, String
defaultPackageName) {
- String packageName = (defaultPackageName != null &&
defaultPackageName.trim().length() > 0)
- ? defaultPackageName : null;
-
- if (packageName == null) {
- packageName = getPackageNameByNameSpaceURI(namespace);
- }
- return packageName;
+ return (defaultPackageName != null && !defaultPackageName.isEmpty())
Review comment:
Not sure how important it is in this context, but `.trim()` is lost:
`!defaultPackageName.trim().isEmpty()`. Just to note, `" ".isEmpty == false`,
whereas `" ".trim().isEmpty == true`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services