Affected file
ojp-jdbc-driver/src/main/java/org/openjproxy/jdbc/Savepoint.java
Java
private T retrieveAttribute(CallType callType, String attrName, Class returnType) throws SQLException {
...
return (T) result; // unchecked cast
}
Expected fix
Use the generic form of Class:
Java
private T retrieveAttribute(CallType callType, String attrName, Class returnType) throws SQLException {
...
return returnType.cast(result);
}
How to verify
Run mvn checkstyle:check and mvn clean compile — must pass with no new warnings.
Affected file
ojp-jdbc-driver/src/main/java/org/openjproxy/jdbc/Savepoint.java
Java
private T retrieveAttribute(CallType callType, String attrName, Class returnType) throws SQLException {
...
return (T) result; // unchecked cast
}
Expected fix
Use the generic form of Class:
Java
private T retrieveAttribute(CallType callType, String attrName, Class returnType) throws SQLException {
...
return returnType.cast(result);
}
How to verify
Run mvn checkstyle:check and mvn clean compile — must pass with no new warnings.