This is an automated email from the ASF dual-hosted git repository.
slfan1989 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 1bd4835a3d1 HADOOP-19305: Fix ProcessEnvironment ClassCastException in
Shell.java (#7106) Contributed by Butao Zhang.
1bd4835a3d1 is described below
commit 1bd4835a3d10dd7af1f91cea7970ea4b007d60d7
Author: Butao Zhang <[email protected]>
AuthorDate: Fri Jan 10 09:30:46 2025 +0800
HADOOP-19305: Fix ProcessEnvironment ClassCastException in Shell.java
(#7106) Contributed by Butao Zhang.
Signed-off-by: Shilun Fan <[email protected]>
---
.../hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
index e0d199ea863..c53ddc0725c 100644
---
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
+++
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java
@@ -977,7 +977,9 @@ public abstract class Shell {
builder.environment().clear();
}
- builder.environment().putAll(this.environment);
+ if (!environment.isEmpty()) {
+ builder.environment().putAll(this.environment);
+ }
if (dir != null) {
builder.directory(this.dir);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]