Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-9377

Fix findbugs warnings in FSDirSnapshotOp

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.8.0, 3.0.0-alpha1
    • namenode
    • None
    • Reviewed

    Description

      I ran findbugs version 3.0.1 and find there is a findbugs warning in FSDirSnapshotOp, brought by HDFS-9231.

      It's caused by unused variable and the fix is simple.

      findbugsXml.xml
      <BugInstance rank="17" category="STYLE" instanceHash="e553cd68a81bb1d8aaf6eba15aa9d322" instanceOccurrenceNum="0" priority="2" abbrev="DLS" type="DLS_DEAD_LOCAL_STORE" cweid="563" instanceOccurrenceMax="0">
      <ShortMessage>Dead store to local variable</ShortMessage>
      <LongMessage>
      Dead store to sfi in org.apache.hadoop.hdfs.server.namenode.FSDirSnapshotOp.getSnapshotFiles(FSDirectory, List, String)
      </LongMessage>
      <Class classname="org.apache.hadoop.hdfs.server.namenode.FSDirSnapshotOp" primary="true">
      <SourceLine start="41" classname="org.apache.hadoop.hdfs.server.namenode.FSDirSnapshotOp" sourcepath="org/apache/hadoop/hdfs/server/namenode/FSDirSnapshotOp.java" sourcefile="FSDirSnapshotOp.java" end="279">
      <Message>At FSDirSnapshotOp.java:[lines 41-279]</Message>
      </SourceLine>
      <Message>
      In class org.apache.hadoop.hdfs.server.namenode.FSDirSnapshotOp
      </Message>
      </Class>
      <Method isStatic="true" classname="org.apache.hadoop.hdfs.server.namenode.FSDirSnapshotOp" name="getSnapshotFiles" primary="true" signature="(Lorg/apache/hadoop/hdfs/server/namenode/FSDirectory;Ljava/util/List;Ljava/lang/String;)Ljava/util/Collection;">
      <SourceLine endBytecode="85" startBytecode="0" start="174" classname="org.apache.hadoop.hdfs.server.namenode.FSDirSnapshotOp" sourcepath="org/apache/hadoop/hdfs/server/namenode/FSDirSnapshotOp.java" sourcefile="FSDirSnapshotOp.java" end="197"/>
      <Message>
      In method org.apache.hadoop.hdfs.server.namenode.FSDirSnapshotOp.getSnapshotFiles(FSDirectory, List, String)
      </Message>
      </Method>
      <LocalVariable register="4" name="sfi" pc="16" role="LOCAL_VARIABLE_NAMED">
      <Message>Local variable named sfi</Message>
      </LocalVariable>
      <SourceLine endBytecode="14" startBytecode="14" start="175" classname="org.apache.hadoop.hdfs.server.namenode.FSDirSnapshotOp" primary="true" sourcepath="org/apache/hadoop/hdfs/server/namenode/FSDirSnapshotOp.java" sourcefile="FSDirSnapshotOp.java" end="175">
      <Message>At FSDirSnapshotOp.java:[line 175]</Message>
      </SourceLine>
      <Property name="edu.umd.cs.findbugs.detect.DeadLocalStoreProperty.METHOD_RESULT" value="true"/>
      <Property name="edu.umd.cs.findbugs.detect.DeadLocalStoreProperty.LOCAL_NAME" value="sfi"/>
      <Property name="edu.umd.cs.findbugs.detect.DeadLocalStoreProperty.NO_LOADS" value="true"/>
      </BugInstance>
      

      Attachments

        1. HDFS-9377.000.patch
          1 kB
          Mingliang Liu

        Issue Links

          Activity

            People

              liuml07 Mingliang Liu
              liuml07 Mingliang Liu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: