From 3539156dea01e72242ea506f4fb7a14e7777d027 Mon Sep 17 00:00:00 2001 From: Mahadev Konar Date: Mon, 21 Nov 2011 18:15:44 +0000 Subject: [PATCH] HADOOP-7843. compilation failing because workDir not initialized in RunJar.java (John George via mahadev) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1204629 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/util/RunJar.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 170ea3f8d16..277da1d0dad 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -28,6 +28,9 @@ Release 0.23.1 - Unreleased HADOOP-6614. RunJar should provide more diags when it can't create a temp file. (Jonathan Hsieh via eli) + HADOOP-7843. compilation failing because workDir not initialized in + RunJar.java (John George via mahadev) + Release 0.23.0 - 2011-11-01 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java index e6c6a14eeae..58510bfba3f 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java @@ -149,7 +149,7 @@ public class RunJar { File tmpDir = new File(new Configuration().get("hadoop.tmp.dir")); ensureDirectory(tmpDir); - File workDir; + final File workDir; try { workDir = File.createTempFile("hadoop-unjar", "", tmpDir); } catch (IOException ioe) { @@ -158,6 +158,7 @@ public class RunJar { System.err.println("Error creating temp dir in " + tmpDir + " due to " + ioe.getMessage()); System.exit(-1); + return; } if (!workDir.delete()) {