cpoerschke commented on issue #1172: SOLR-14189 switch from String.trim() to 
StringUtils.isWhitespace()
URL: https://github.com/apache/lucene-solr/pull/1172#issuecomment-578136051
 
 
   > ... String.trim() ... StringUtils.stripToNull() ... 
StringUtils.isWhitespace() ...
   
   I wonder if `StringUtils.isBlank()` might be another option:
   
   ```
   - if (val == null || StringUtils.isWhitespace(val) ) {
   + if (StringUtils.isBlank(val)) {
   ```
   
   Not sure about `StringUtils.isWhitespace` vs. `StringUtils.isBlank` 
efficiency considerations though e.g. 
https://github.com/apache/lucene-solr/blob/releases/lucene-solr/8.4.1/solr/core/src/java/org/apache/solr/search/SwitchQParserPlugin.java#L166
 uses it.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to