[GitHub] coheigea commented on issue #479: String.split via fastpath instead of precompiled Pattern

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] coheigea commented on issue #479: String.split via fastpath instead of precompiled Pattern

GitBox
coheigea commented on issue #479: String.split via fastpath instead of precompiled Pattern
URL: https://github.com/apache/cxf/pull/479#issuecomment-444877719
 
 
   Hi @amarkevich,
   
   The following methods are not used in source (main) code any more and could be removed:
   
   StringUtils.getFirstNotEmpty
   StringUtils.splitAsStream
   
   StringUtils.getParts could also be removed, it is called here:
   
   AbstractHttpDestination: StringUtils.getParts(credentials, " ");
   PackageUtils: StringUtils.getParts(getPackageName(cls), "\\.")
   
   For both these cases you could replace with String.split + convert the non-empty values to a List.
   
   Finally, that leaves HttpHeadersImpl as the only place that is calling StringUtils.split. For several of the cases here it is a single character, for others not. You could move the StringUtils split functionality into this class + see if you can re-use split for the case that it's a single character, otherwise use a pre-compiled pattern separator?
   

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services