hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabor Bota (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HADOOP-16230) Corrcet findbug ignores for unjustified issues during update to guava to 27.0-jre in hadoop-project
Date Tue, 02 Apr 2019 12:35:00 GMT
Gabor Bota created HADOOP-16230:
-----------------------------------

             Summary: Corrcet findbug ignores for unjustified issues during update to guava
to 27.0-jre in hadoop-project
                 Key: HADOOP-16230
                 URL: https://issues.apache.org/jira/browse/HADOOP-16230
             Project: Hadoop Common
          Issue Type: Sub-task
            Reporter: Gabor Bota


In HADOOP-16220 I’ve added
{code:java}
<Match>
       <Class name="org.apache.hadoop.hdfs.qjournal.server.Journal" />
       <Method name="persistPaxosData" />
       <Bug pattern="NP_NULL_PARAM_DEREF" />
     </Match>
{code}
instead of
{code:java}
     <Match>
       <Class name="org.apache.hadoop.hdfs.qjournal.server.Journal" />
       <Method name="getPersistedPaxosData" />
       <Bug pattern="NP_NULL_PARAM_DEREF" />
     </Match>
{code}

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
{code:java}
Preconditions.checkState(ret != null &&
          ret.getSegmentState().getStartTxId() == segmentTxId,
          "Bad persisted data for segment %s: %s ; journal id: %s",
          segmentTxId, ret, journalId);
{code}
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:
{code:java}
  public static void checkState(
      boolean b,
      @Nullable String errorMessageTemplate,
      @Nullable Object p1,
      @Nullable Object p2,
      @Nullable Object p3) {
{code}
so we have {{@Nullable}} on each parameter for the method. I don't see this warning as justified,
or need to be fixed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message