pmd corrections

Former-commit-id: 7cdc5b009285b9b428d4e731cb4b493a24453a9f
This commit is contained in:
Jeremy Long
2014-11-05 21:31:00 -05:00
parent 0a45048535
commit ea15205be8
2 changed files with 7 additions and 7 deletions

View File

@@ -286,14 +286,12 @@ public class CPEAnalyzer implements Analyzer {
return ret;
} catch (ParseException ex) {
final String msg = String.format("Unable to parse: %s", searchString);
Logger.getLogger(CPEAnalyzer.class.getName()).log(Level.WARNING,
"An error occured querying the CPE data. See the log for more details.");
Logger.getLogger(CPEAnalyzer.class.getName()).log(Level.INFO, msg, ex);
LOGGER.log(Level.WARNING, "An error occured querying the CPE data. See the log for more details.");
LOGGER.log(Level.INFO, msg, ex);
} catch (IOException ex) {
final String msg = String.format("IO Error with search string: %s", searchString);
Logger.getLogger(CPEAnalyzer.class.getName()).log(Level.WARNING,
"An error occured reading CPE data. See the log for more details.");
Logger.getLogger(CPEAnalyzer.class.getName()).log(Level.INFO, msg, ex);
LOGGER.log(Level.WARNING, "An error occured reading CPE data. See the log for more details.");
LOGGER.log(Level.INFO, msg, ex);
}
return null;
}

View File

@@ -54,7 +54,9 @@ public final class DBUtils {
int id = 0;
try {
rs = statement.getGeneratedKeys();
rs.next();
if (!rs.next()) {
throw new DatabaseException("Unable to get primary key for inserted row");
}
id = rs.getInt(1);
} catch (SQLException ex) {
throw new DatabaseException("Unable to get primary key for inserted row");