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_r248520673
 
 

 ##########
 File path: core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
 ##########
 @@ -123,11 +119,12 @@ public static String getPackageNameByNameSpaceURI(String 
nameSpaceURI) {
         if (idx >= 0) {
             domain = domain.substring(0, idx);
         }
-        List<String> r = reverse(tokenize(domain, "urn".equals(scheme) ? ".-" 
: "."));
-        if ("www".equalsIgnoreCase(r.get(r.size() - 1))) {
+        List<String> r = tokenize(domain, "urn".equals(scheme) ? ".-" : ".");
+        if ("www".equalsIgnoreCase(r.get(0))) {
 
 Review comment:
   Intuitively, since most of the time we are dealing with `ArrayList`, 
removing from the end of the list is more efficient than from the beginning of 
the list. 

----------------------------------------------------------------
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

Reply via email to