From 4c71b0da4ad11049d01aa5c2e10292711cf7b5dc Mon Sep 17 00:00:00 2001 From: pyxide Date: Sat, 17 Dec 2016 22:05:03 +0100 Subject: [PATCH] checkstyle fixes --- .../main/java/net/sourceforge/pmd/ant/Formatter.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java b/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java index d993062e92..7d2a590eb8 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/ant/Formatter.java @@ -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);