error-prone
error-prone copied to clipboard
Rule request: redundant type cast
Be nice to a have a rule against redundant type casts, and a patch to remove them.
Here's a case for it:
- https://github.com/pgjdbc/pgjdbc/pull/3631
The problematic case was calling a method that was already available on the base java.sql.Statement:
try (Statement checkConnectionQuery = createStatement()) {
// The cast to PgStatement is redundant here:
((PgStatement)checkConnectionQuery).execute("", QueryExecutor.QUERY_EXECUTE_AS_SIMPLE);
}