#431 Check RequireThis doesn't filter out static variables

release_4.1
closed
5
2012-10-10
2006-05-18
Olaf Kossak
No

The configuration of check RequireThis

<module name="RequireThis">
<property name="checkFields" value="true"/>
<property name="checkMethods" value="true"/>
<property name="severity" value="warning"/>
</module>

unfortunately leads reports error on:

...
private static final Logger logger = Logger.getLogger
(My.class);
...
logger.debug("execute()");
...

According to the JLS static variables shall not be
referenced by "this."

Discussion

  • Logged In: YES
    user_id=746148

    duplicate of 1155921 (RequireThis requires adding "this." to
    static members)