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

Chris Douglas edited comment on HDFS-12915 at 12/18/17 8:37 AM:
----------------------------------------------------------------

Thanks for taking a look, [~Sammi].

bq. Preconditions does support formatted strings.
IIRC the unit test failed because {{%02x}} was printing as a literal, not as a 
2-digit hex string using the passed parameter. Replacing an if/throw statement 
with a call to a third-party library seems unnecessary. If it's not cleaner in 
this case then its appeal, even aesthetically, is limited...

bq. the last update of the findbugs web site is Mar. 2015. Seems it's lack of 
maintenance these days.
The project switched to [Spotbugs|https://spotbugs.github.io/] (HADOOP-14316).

bq. If erasureCodingPolicyID is null and blockType is stripped, it should throw 
exception. REPLICATION_POLICY_ID is a special EC policy. It represents the "3 
replica" scheme. File with this policy is effectively 3 replica file, not EC 
file.
I also thought that was odd, but it's the existing behavior if it can be 
returned by the policy manager. Will add this to the set of errors checked.


was (Author: chris.douglas):
Thanks for taking a look, [~Sammi].

bq. Preconditions does support formatted strings.
IIRC the unit test failed because {{%02x}} was printing as a literal, not as a 
2-digit hex string using the passed parameter. Replacing an if/throw statement 
with a call to a third-party library seems unnecessary. If it's not cleaner in 
this case then its appeal, even aesthetically, is limited...

bq. the last update of the findbugs web site is Mar. 2015. Seems it's lack of 
maintenance these days.
The project switched to [Spotbugs|https://spotbugs.github.io/] (HADOOP-14316).

bq. If erasureCodingPolicyID is null and blockType is stripped, it should throw 
exception. REPLICATION_POLICY_ID is a special EC policy. It represents the "3 
replica" scheme. File with this policy is effectively 3 replica file, not EC 
file.
I also thought that was odd, but it's the existing behavior. Will add this to 
the set of errors checked.

> Fix findbugs warning in INodeFile$HeaderFormat.getBlockLayoutRedundancy
> -----------------------------------------------------------------------
>
>                 Key: HDFS-12915
>                 URL: https://issues.apache.org/jira/browse/HDFS-12915
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: namenode
>    Affects Versions: 3.0.0
>            Reporter: Wei-Chiu Chuang
>         Attachments: HDFS-12915.00.patch, HDFS-12915.01.patch
>
>
> It seems HDFS-12840 creates a new findbugs warning.
> Possible null pointer dereference of replication in 
> org.apache.hadoop.hdfs.server.namenode.INodeFile$HeaderFormat.getBlockLayoutRedundancy(BlockType,
>  Short, Byte)
> Bug type NP_NULL_ON_SOME_PATH (click for details) 
> In class org.apache.hadoop.hdfs.server.namenode.INodeFile$HeaderFormat
> In method 
> org.apache.hadoop.hdfs.server.namenode.INodeFile$HeaderFormat.getBlockLayoutRedundancy(BlockType,
>  Short, Byte)
> Value loaded from replication
> Dereferenced at INodeFile.java:[line 210]
> Known null at INodeFile.java:[line 207]
> From a quick look at the patch, it seems bogus though. [~eddyxu][~Sammi] 
> would you please double check?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to