From eeb39dc21853f2e670d6be76d8fe3f002d559f42 Mon Sep 17 00:00:00 2001 From: Colin Patrick Mccabe Date: Mon, 6 Oct 2014 15:29:09 -0700 Subject: [PATCH] HDFS-7194 Fix findbugs "inefficient new String constructor" warning in DFSClient#PATH (yzhang via cmccabe) (cherry picked from commit 8dc6abf2f4218b2d84b2c2dc7d18623d897c362d) --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 4 ++++ .../src/main/java/org/apache/hadoop/hdfs/DFSClient.java | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 337284a06d3..2ec50048ad8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -7,11 +7,15 @@ Release 2.7.0 - UNRELEASED NEW FEATURES IMPROVEMENTS + HDFS-7055. Add tracing to DFSInputStream (cmccabe) OPTIMIZATIONS BUG FIXES + + HDFS-7194. Fix findbugs "inefficient new String constructor" warning in + DFSClient#PATH (yzhang via cmccabe) Release 2.6.0 - UNRELEASED diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java index 86faf1853d1..f54d325b71f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java @@ -3174,8 +3174,7 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory, return saslClient; } - private static final byte[] PATH = - new String("path").getBytes(Charset.forName("UTF-8")); + private static final byte[] PATH = "path".getBytes(Charset.forName("UTF-8")); TraceScope getPathTraceScope(String description, String path) { TraceScope scope = Trace.startSpan(description, traceSampler);