GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||
GeezerVison is showing github.com — [java] False negative: LiteralsFirstInComparisons for methods... (2569) by Drofff · Pull Request #2651 · pmd/pmd Conversation
Contributor
returning Strings Describe the PRI've changed the way we are getting operation name and primarySuffix in LiteralsFirstInComparisonsRule class, in order to fix false negative at methods chaining like this one: In case we have methods chaining like the one above, there are multiple primarySuffixes and comparison operation name is no longer in a primary prefix, it's in (n - 1)th primarySuffix. Also I've refactored some other methods of the class. Related issuesReady?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…ng Strings (2569)
|
There was an error while loading. Please reload this page.
Generated by 🚫 Danger |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
This is almost ready, I just found one false-positive, which we should fix:
booleanField = "Hello, World!".equals("Hello, Checkstyle!");
Could you add a test case for this and ignore, if the string method is already called on a string?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good now, this will be part of 6.26.0
Sorry, something went wrong.
There was an error while loading. Please reload this page.
[java] False negative: LiteralsFirstInComparisons for methods... (2569) #2651
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[java] LiteralsFirstInComparisons: False negative for methods returning Strings
There was an error while loading. Please reload this page.