[doc][java] Add hint for Guava users in InefficientEmptyStringCheck

Fixes issue #571.
This commit is contained in:
Marcel Möhring
2017-08-22 22:45:08 +02:00
parent 08dddc2ba7
commit dbf3adb770

View File

@@ -221,8 +221,9 @@ if (s.indexOf('d') {}
String.trim().length() is an inefficient way to check if a String is really empty, as it
creates a new String object just to check its size. Consider creating a static function that
loops through a string, checking Character.isWhitespace() on each character and returning
false if a non-whitespace character is found. You can refer to Apache's StringUtils#isBlank (in commons-lang)
or Spring's StringUtils#hasText (in the Springs framework) for existing implementations.
false if a non-whitespace character is found. You can refer to Apache's StringUtils#isBlank (in commons-lang),
Spring's StringUtils#hasText (in the Spring framework) or Google's CharMatcher#whitespace (in Guava) for
existing implementations.
</description>
<priority>3</priority>
<example>