Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-15960 Update guava to 27.0-jre in hadoop-project
  3. HADOOP-16230

Correct findbug ignores for unjustified issues during update to guava to 27.0-jre in hadoop-project

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.3.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      In HADOOP-16220 I’ve added

      <Match>
             <Class name="org.apache.hadoop.hdfs.qjournal.server.Journal" />
             <Method name="persistPaxosData" />
             <Bug pattern="NP_NULL_PARAM_DEREF" />
           </Match>
      

      instead of

           <Match>
             <Class name="org.apache.hadoop.hdfs.qjournal.server.Journal" />
             <Method name="getPersistedPaxosData" />
             <Bug pattern="NP_NULL_PARAM_DEREF" />
           </Match>
      

      So it should be getPersistedPaxosData instead of persistPaxosData.

       

      The following description is correct, but the code was not:

      Null passed for non-null parameter of com.google.common.base.Preconditions.checkState(boolean, String, Object, Object, Object) in org.apache.hadoop.hdfs.qjournal.server.Journal.getPersistedPaxosData(long)
      In org/apache/hadoop/hdfs/qjournal/server/Journal.java:1064 we call

      Preconditions.checkState(ret != null &&
                ret.getSegmentState().getStartTxId() == segmentTxId,
                "Bad persisted data for segment %s: %s ; journal id: %s",
                segmentTxId, ret, journalId);
      

      for this call findbug assumes that Argument 4 might be null but must not be null, but Guava 27.0's com.google.common.base.Preconditions#checkState(boolean, java.lang.String, java.lang.Object, java.lang.Object, java.lang.Object) is annotated like the following:

        public static void checkState(
            boolean b,
            @Nullable String errorMessageTemplate,
            @Nullable Object p1,
            @Nullable Object p2,
            @Nullable Object p3) {
      

      so we have @Nullable on each parameter for the method. I don't see this warning as justified, or need to be fixed.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gabor.bota Gabor Bota
                Reporter:
                gabor.bota Gabor Bota
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: