[ 
https://issues.apache.org/jira/browse/HBASE-5654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13254802#comment-13254802
 ] 

Jonathan Hsieh commented on HBASE-5654:
---------------------------------------

I'm being pretty strict with excludes -- for an excludes it should be explained 
(because they will be ignored forever more.. )

{code}
+        <Match>
+       <Class name="org.apache.hadoop.hbase.regionserver.HRegion"/>
+          <Or>
+         <Method name="exec" />
+       </Or>
+       <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
+     </Match>
{code}

I think this one may have been handled in anther patch -- maybe this exclude 
isn't needed.

{code}
+        <Match>
+       <Class name="org.apache.hadoop.hbase.regionserver.StoreFile$Reader"/>
+          <Or>
+         <Method name="passesGeneralBloomFilter" />
+       </Or>
+       <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
+     </Match>
{code}

This one is definitely fixable in code instead of exclude.

{code}

+        <Match>
+       <Class name="org.apache.hadoop.hbase.filter.FilterList"/>
+          <Or>
+         <Method name="filterKeyValue" />
+       </Or>
+       <Bug pattern="SF_SWITCH_NO_DEFAULT" />
+     </Match>
+
....

+
+        <Match>
+       <Class name="org.apache.hadoop.hbase.master.AssignmentManager"/>
+          <Or>
+         <Method name="processRegionsInTransition" />
+                <Method name="handleRegion" />
+       </Or>
+       <Bug pattern="SF_SWITCH_NO_DEFAULT" />
+     </Match>
+
...
+
+        <Match>
+       <Class 
name="org.apache.hadoop.hbase.master.AssignmentManager$TimeoutMonitor"/>
+          <Or>
+         <Method name="actOnTimeOut" />
+       </Or>
+       <Bug pattern="SF_SWITCH_NO_DEFAULT" />
+     </Match>
+
...
+
+        <Match>
+       <Class 
name="org.apache.hadoop.hbase.master.AssignmentManager$TimeoutMonitor"/>
+          <Or>
+         <Method name="actOnTimeOut" />
+       </Or>
+       <Bug pattern="SF_SWITCH_NO_DEFAULT" />
+     </Match>
+
...
+     <Match>
+       <Class name="org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher"/>
+          <Or>
+         <Method name="connectionEvent" />
+       </Or>
+       <Bug pattern="SF_SWITCH_NO_DEFAULT" />
+     </Match>
 
{code}
Definitely fixable in code without exclude -- (add default case that does 
nothing or enumrate all cases and have default throws some sort of runtime 
exception such as IllegalStateException to catch cases where new enums created).


{code}
     <Match>
+       <Class name="org.apache.hadoop.hbase.util.HBaseFsck"/>
+          <Or>
+         <Method name="setSummary" />
+         <Method name="setDisplayFullReport" />
+       </Or>
+       <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" />
+     </Match>
+
{code}
File a separate jira for this one and I'll take care of it.  Please to do not 
exclude this warning.

{code}
         <Match>
+       <Class name=" org.apache.hadoop.hbase.regionserver.metrics"/>
+          <Or>
+         <Method name="SchemaConfigured" />
+       </Or>
+       <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
+     </Match>
+
+        <Match>
        <Class name="org.apache.hadoop.hbase.regionserver.HRegion"/>
{code}

Does this do anything?  metrics is a package, SchemaConfigured is a class... 

{code}
+
+        <Match>
+       <Class name="org.apache.hadoop.hbase.util.ByteBloomFilter"/>
+          <Or>
+         <Method name="optimalFunctionCount" />
+       </Or>
+       <Bug pattern="ICAST_IDIV_CAST_TO_DOUBLE" />
+     </Match>
+
{code}
Probably wants bitSize and maxKeys to be cased to doubles before div.





                
> [findbugs] Address dodgy bugs
> -----------------------------
>
>                 Key: HBASE-5654
>                 URL: https://issues.apache.org/jira/browse/HBASE-5654
>             Project: HBase
>          Issue Type: Sub-task
>          Components: scripts
>    Affects Versions: 0.96.0
>            Reporter: Jonathan Hsieh
>            Assignee: Ashutosh Jindal
>              Labels: patch
>             Fix For: 0.96.0
>
>         Attachments: Hbase-5654.patch
>
>
> See 
> https://builds.apache.org/job/PreCommit-HBASE-Build/1313//artifact/trunk/patchprocess/newPatchFindbugsWarnings.html#Warnings_STYLE
> This may be broken down further.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to