fixed a bug that caused the suppression file not to load

Former-commit-id: d90f00b1f051fa31c95e957786fd7215dbfdc913
This commit is contained in:
Jeremy Long
2014-03-16 07:02:10 -04:00
parent 8a3dba3064
commit 6decc1ce30

View File

@@ -119,17 +119,20 @@ public abstract class AbstractSuppressionAnalyzer extends AbstractAnalyzer {
} catch (DownloadFailedException ex) { } catch (DownloadFailedException ex) {
Downloader.fetchFile(url, file, true); Downloader.fetchFile(url, file, true);
} }
} else {
file = new File(suppressionFilePath);
} }
if (file != null) { if (file != null) {
final SuppressionParser parser = new SuppressionParser(); final SuppressionParser parser = new SuppressionParser();
try { try {
rules = parser.parseSuppressionRules(file); rules = parser.parseSuppressionRules(file);
Logger.getLogger(AbstractSuppressionAnalyzer.class.getName()).log(Level.FINE, rules.size() + " suppression rules were loaded.");
} catch (SuppressionParseException ex) { } catch (SuppressionParseException ex) {
final String msg = String.format("Unable to parse suppression xml file '%s'", file.getPath()); final String msg = String.format("Unable to parse suppression xml file '%s'", file.getPath());
Logger.getLogger(AbstractSuppressionAnalyzer.class.getName()).log(Level.WARNING, msg); Logger.getLogger(AbstractSuppressionAnalyzer.class.getName()).log(Level.WARNING, msg);
Logger.getLogger(AbstractSuppressionAnalyzer.class.getName()).log(Level.WARNING, ex.getMessage()); Logger.getLogger(AbstractSuppressionAnalyzer.class.getName()).log(Level.WARNING, ex.getMessage());
Logger.getLogger(AbstractSuppressionAnalyzer.class.getName()).log(Level.FINE, null, ex); Logger.getLogger(AbstractSuppressionAnalyzer.class.getName()).log(Level.FINE, "", ex);
throw ex; throw ex;
} }
} }