forked from alibaba/p3c
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle [string literal].equals() correctly in EqualsAvoidNullRule
This fixes alibaba#471 Previously, the following code can't pass EqualsAvoidNullRule: public class Test { private static final String VERSION = System.getProperty("v"); public boolean isJava6(){ return "1.6".equals(VERSION); } } This PR fixes this issue by checking if the caller is a literal.
- Loading branch information
1 parent
3cf2594
commit 1dc88f5
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters