Menu

#1600 In displaySqlResults of org.hsqldb.cmdline.SqlFile, logger.warning(...) should be logger.error(...) to record exception

version 2.5.x
open
None
5
2020-11-22
2020-10-30
Xiaoqin Fu
No

package org.hsqldb.cmdline;
public class SqlFile {
private static FrameworkLogger logger =
FrameworkLogger.getLog(SqlFile.class);
......
private void displaySqlResults(Statement statement,
ResultSet r, final int[] incCols, final String filterString,
final boolean updateStatus) throws SQLException, SqlToolError {
try {
......
} finally {
if (r != null) try {
r.close();
} catch (SQLException se) {
logger.warning("Failed to close SQL result set: " + se);
} finally {
r = null;
}
if (statement != null) try {
statement.close();
} catch (SQLException se) {
logger.warning("Failed to close SQL statement: " + se);
} finally {
statement = null;
}
}
}

Two statements logger.warning("Failed to close SQL result set: " + se) and logger.warning("Failed to close SQL statement: " + se) should be logger.error("Failed to close SQL result set: " + se) and logger.error("Failed to close SQL statement: " + se), respectively.
The reason is that they record exception messages.

Discussion

  • Xiaoqin Fu

    Xiaoqin Fu - 2020-11-22

    Could I open a PR for it?

     
  • Fred Toussi

    Fred Toussi - 2020-11-22

    Please wait until this is reviewed and a decision is made.

     

Log in to post a comment.

MongoDB Logo MongoDB