Skip to content

Commit 2625e99

Browse files
committed
HADOOP-19305: Fix ProcessEnvironment ClassCastException in Shell.java
1 parent f65747d commit 2625e99

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)