diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/ZoneReencryptionStatus.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/ZoneReencryptionStatus.java index 9022b9ffd9..c7628d8dd9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/ZoneReencryptionStatus.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/ZoneReencryptionStatus.java @@ -223,7 +223,7 @@ public void reset() { * a listReencryptionStatus call, for the crypto admin to consume. */ public void setZoneName(final String name) { - Preconditions.checkNotNull(name == null); + Preconditions.checkNotNull(name, "zone name cannot be null"); zoneName = name; } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/AdminHelper.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/AdminHelper.java index 2c5fb0e1e8..391dcb6346 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/AdminHelper.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/AdminHelper.java @@ -145,7 +145,7 @@ static class HelpCommand implements Command { private final Command[] commands; public HelpCommand(Command[] commands) { - Preconditions.checkNotNull(commands != null); + Preconditions.checkNotNull(commands, "commands cannot be null."); this.commands = commands; }