Skip to content

Commit 1bd4835

Browse files
authored
HADOOP-19305: Fix ProcessEnvironment ClassCastException in Shell.java (#7106) Contributed by Butao Zhang.
Signed-off-by: Shilun Fan <[email protected]>
1 parent 37bdf94 commit 1bd4835

File tree

1 file changed

+3
-1
lines changed
  • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util

1 file changed

+3
-1
lines changed

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,9 @@ private void runCommand() throws IOException {
977977
builder.environment().clear();
978978
}
979979

980-
builder.environment().putAll(this.environment);
980+
if (!environment.isEmpty()) {
981+
builder.environment().putAll(this.environment);
982+
}
981983

982984
if (dir != null) {
983985
builder.directory(this.dir);

0 commit comments

Comments
 (0)