From 8baf9682c05069b5245c81ffdb97f0fdd65dd0b9 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 6 Aug 2008 16:50:03 +0000 Subject: [PATCH] making findbugs happier git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11273 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/FilePath.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index 9685d70f09..918b425c96 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -682,15 +682,11 @@ public final class FilePath implements Serializable { File f = new File(remote); f.getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(f); + Writer w = encoding != null ? new OutputStreamWriter(fos, encoding) : new OutputStreamWriter(fos); try { - Writer w; - if(encoding!=null) - w = new OutputStreamWriter(fos, encoding); - else - w = new OutputStreamWriter(fos); w.write(content); } finally { - fos.close(); + w.close(); } return null; }