From 0c53ed4cd122f87b2b041d670b9b59e27da5439c Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Sun, 16 Sep 2012 21:10:39 +0000 Subject: [PATCH] HADOOP-8818. Use equals instead == in MD5MD5CRC32FileChecksum and TFileDumper. Contributed by Brandon Li. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1385374 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../java/org/apache/hadoop/fs/MD5MD5CRC32FileChecksum.java | 2 +- .../main/java/org/apache/hadoop/io/file/tfile/TFileDumper.java | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 2e13b227c9..0ff925ef80 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -208,6 +208,9 @@ Trunk (Unreleased) HADOOP-8767. Secondary namenode is started on slave nodes instead of master nodes. (Giovanni Delussu via suresh) + HADOOP-8818. Use equals instead == in MD5MD5CRC32FileChecksum + and TFileDumper. (Brandon Li via suresh) + OPTIMIZATIONS HADOOP-7761. Improve the performance of raw comparisons. (todd) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/MD5MD5CRC32FileChecksum.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/MD5MD5CRC32FileChecksum.java index 5bddb96f0c..0eb77ddd96 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/MD5MD5CRC32FileChecksum.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/MD5MD5CRC32FileChecksum.java @@ -133,7 +133,7 @@ public static MD5MD5CRC32FileChecksum valueOf(Attributes attrs try { // old versions don't support crcType. - if (crcType == null || crcType == "") { + if (crcType == null || crcType.equals("")) { finalCrcType = DataChecksum.Type.CRC32; } else { finalCrcType = DataChecksum.Type.valueOf(crcType); diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/TFileDumper.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/TFileDumper.java index f065e62d0f..829a1c68c4 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/TFileDumper.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/TFileDumper.java @@ -125,7 +125,7 @@ static public void dumpInfo(String file, PrintStream out, Configuration conf) dataSizeUncompressed += region.getRawSize(); } properties.put("Data Block Bytes", Long.toString(dataSize)); - if (reader.readerBCF.getDefaultCompressionName() != "none") { + if (!reader.readerBCF.getDefaultCompressionName().equals("none")) { properties.put("Data Block Uncompressed Bytes", Long .toString(dataSizeUncompressed)); properties.put("Data Block Compression Ratio", String.format(