checkstyle fixes

This commit is contained in:
pyxide
2016-12-17 22:05:03 +01:00
committed by Juan Martín Sotuyo Dodero
parent 368313fd8f
commit 4c71b0da4a

View File

@ -1,6 +1,7 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.ant;
import java.io.BufferedWriter;
@ -71,8 +72,7 @@ public class Formatter {
if (null == s) {
charset = StandardCharsets.UTF_8;
properties.put("encoding", charset.name());
}
else {
} else {
charset = Charset.forName(s);
}
}
@ -152,12 +152,11 @@ public class Formatter {
return properties;
}
private static final Writer getToFileWriter(String baseDir, File toFile, Charset charset) throws IOException {
private static Writer getToFileWriter(String baseDir, File toFile, Charset charset) throws IOException {
final File file;
if (toFile.isAbsolute()) {
file = toFile;
}
else {
} else {
file = new File(baseDir + System.getProperty("file.separator") + toFile.getPath());
}
@ -169,8 +168,7 @@ public class Formatter {
writer = new OutputStreamWriter(output, charset);
writer = new BufferedWriter(writer);
isOnError = false;
}
finally {
} finally {
if (isOnError) {
IOUtils.closeQuietly(output);
IOUtils.closeQuietly(writer);