Merge branch 'pr-576'
This commit is contained in:
@@ -232,3 +232,5 @@ All existing rules have been updated to reflect these changes. If you have custo
|
||||
* [#557](https://github.com/pmd/pmd/pull/557): \[java] Fix NPath metric not counting ternaries correctly - [Clément Fournier](https://github.com/oowekyala)
|
||||
* [#563](https://github.com/pmd/pmd/pull/563): \[java] Add support for basic method type inference for strict invocation - [Bendegúz Nagy](https://github.com/WinterGrascph)
|
||||
* [#567](https://github.com/pmd/pmd/pull/567): \[java] Last API change for metrics (metric options) - [Clément Fournier](https://github.com/oowekyala)
|
||||
* [#576](https://github.com/pmd/pmd/pull/576): \[doc][java] Add hint for Guava users in InefficientEmptyStringCheck - [mmoehring](https://github.com/mmoehring)
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user