Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
Reviewed
Description
In FSImageFormatProtobuf.SectionName#fromString(), as follows:
public static SectionName fromString(String name) { for (SectionName n : values) { if (n.name.equals(name)) return n; } return null; }
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:
switch (SectionName.fromString(n))
NPE will be thrown here.