False positive with overload methods in StaticCandidate #397

Closed
romani opened this Issue Nov 10, 2015 · 0 comments

Projects

None yet

2 participants

@romani
Member
romani commented Nov 10, 2015
class A extends B {

    private void addStatus(int id, String status) { // VIOLATION on this method, fix cause compilation error
        executeUpdate("insert into ....", id, status); // executeUpdate(String sql, Object... params) is used
    }

    private void executeUpdate(String sql, Object... params) {
        executeUpdate(getConfig().getJdbcTemplate(), sql, params); //getConfig() is from parent class
    }

    private static void executeUpdate(JdbcTemplate template, String sql, Object... params) {
        template.update(sql, params);
    }

}
@romani romani changed the title from False positive 2 in StaticCandidate to False positive with overload methods in StaticCandidate Nov 10, 2015
@Vladlis Vladlis was assigned by romani Nov 13, 2015
@Vladlis Vladlis added a commit to Vladlis/sevntu.checkstyle that referenced this issue Nov 16, 2015
@Vladlis Vladlis Issue #397: Fix false-positive on methods with varargs 4d9584b
@Vladlis Vladlis added a commit to Vladlis/sevntu.checkstyle that referenced this issue Nov 16, 2015
@Vladlis Vladlis Issue #397: Fix false-positive on methods with varargs 8dee1df
@romani romani closed this Nov 16, 2015
@romani romani modified the milestone: 1.18 Nov 16, 2015
@romani romani added this to the 1.17.1 milestone Dec 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment