You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2019/01/17 02:21:23 UTC

[GitHub] reta commented on a change in pull request #501: cxf-core: use String.isEmpty(); remove duplicate

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()`. `" ".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:
users@infra.apache.org


With regards,
Apache Git Services