Browse Source

HDFS-7198. Fix "unchecked conversion" warning in DFSClient#getPathTraceScope (cmccabe)

Colin Patrick Mccabe 10 years ago
parent
commit
1ceb326933

+ 1 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceSamplerFactory.java

@@ -30,7 +30,7 @@ public class TraceSamplerFactory {
   private static final Logger LOG =
       LoggerFactory.getLogger(TraceSamplerFactory.class);
 
-  public static Sampler createSampler(Configuration conf) {
+  public static Sampler<?> createSampler(Configuration conf) {
     String samplerStr = conf.get(CommonConfigurationKeys.HADOOP_TRACE_SAMPLER,
         CommonConfigurationKeys.HADOOP_TRACE_SAMPLER_DEFAULT);
     if (samplerStr.equals("NeverSampler")) {

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -386,6 +386,9 @@ Release 2.7.0 - UNRELEASED
     HDFS-7194. Fix findbugs "inefficient new String constructor" warning in
     DFSClient#PATH (yzhang via cmccabe)
 
+    HDFS-7198. Fix or suppress findbugs "unchecked conversion" warning in
+    DFSClient#getPathTraceScope (cmccabe)
+
 Release 2.6.0 - UNRELEASED
 
   INCOMPATIBLE CHANGES

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java

@@ -277,7 +277,7 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
   @VisibleForTesting
   KeyProvider provider;
   private final SpanReceiverHost spanReceiverHost;
-  private final Sampler traceSampler;
+  private final Sampler<?> traceSampler;
 
   /**
    * DFSClient configuration