misc cleanup

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7346 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Brian Remedios
2011-09-25 04:00:29 +00:00
parent 5fe7f691e9
commit 27e8668ba0
2 changed files with 12 additions and 19 deletions

View File

@ -42,6 +42,7 @@ import net.sourceforge.pmd.lang.xpath.Initializer;
import net.sourceforge.pmd.renderers.Renderer;
import net.sourceforge.pmd.util.Benchmark;
import net.sourceforge.pmd.util.FileUtil;
import net.sourceforge.pmd.util.IOUtil;
import net.sourceforge.pmd.util.datasource.DataSource;
import net.sourceforge.pmd.util.log.ConsoleLogHandler;
import net.sourceforge.pmd.util.log.ScopedLogHandlersManager;
@ -200,10 +201,7 @@ public class PMD {
} catch (Exception e) {
throw new PMDException("Error while processing " + ctx.getSourceCodeFilename(), e);
} finally {
try {
reader.close();
} catch (IOException e) {
}
IOUtil.closeQuietly(reader);
}
}

View File

@ -16,6 +16,7 @@ import java.util.Properties;
import net.sourceforge.pmd.PMD;
import net.sourceforge.pmd.Report;
import net.sourceforge.pmd.RuleViolation;
import net.sourceforge.pmd.util.IOUtil;
/**
* <p>A console renderer with optional color support under *nix systems.</p>
@ -176,13 +177,7 @@ public class TextColorRenderer extends AbstractAccumulatingRenderer {
} catch (IOException ioErr) {
ioErr.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException ioErr) {
ioErr.printStackTrace();
}
}
IOUtil.closeQuietly(br);
}
return code;
}