SONARJAVA-248 Only apply to public methods