Handle [string literal].equals() correctly in EqualsAvoidNullRule
This fixes https://github.com/alibaba/p3c/issues/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.
Showing
想要评论请 注册 或 登录