[
https://issues.apache.org/jira/browse/HDFS-14172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16763571#comment-16763571
]
Hudson commented on HDFS-14172:
-------------------------------
SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #15917 (See
[https://builds.apache.org/job/Hadoop-trunk-Commit/15917/])
HDFS-14172. Avoid NPE when SectionName#fromString returns null. (yqlin: rev
177131793a88960b734038f6e646476d568c3626)
* (edit)
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/PBImageXmlWriter.java
* (edit)
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormatProtobuf.java
* (edit)
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/PBImageTextWriter.java
* (edit)
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/FSImageLoader.java
> Avoid NPE when SectionName#fromString returns null
> --------------------------------------------------
>
> Key: HDFS-14172
> URL: https://issues.apache.org/jira/browse/HDFS-14172
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: Xiang Li
> Assignee: Xiang Li
> Priority: Minor
> Fix For: 3.3.0
>
> Attachments: HADOOP-14172.000.patch, HADOOP-14172.001.patch,
> HADOOP-14172.002.patch, HADOOP-14172.003.patch, HADOOP-14172.004.patch,
> HADOOP-14172.005.patch, HADOOP-14172.006.patch
>
>
> In FSImageFormatProtobuf.SectionName#fromString(), as follows:
> {code:java}
> public static SectionName fromString(String name) {
> for (SectionName n : values) {
> if (n.name.equals(name))
> return n;
> }
> return null;
> }
> {code}
> When the code meets an unknown section from the fsimage, the function will
> return null. Callers always operates the return value with a "switch" clause,
> like FSImageFormatProtobuf.Loader#loadInternal(), as:
> {code:java}
> switch (SectionName.fromString(n))
> {code}
> NPE will be thrown here.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]