You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Error Reporter (Jira)" <ji...@apache.org> on 2021/05/10 03:29:00 UTC
[jira] [Created] (HADOOP-17688) Potenail NPE in org.apache.hadoop.classification.tools
Error Reporter created HADOOP-17688:
---------------------------------------
Summary: Potenail NPE in org.apache.hadoop.classification.tools
Key: HADOOP-17688
URL: https://issues.apache.org/jira/browse/HADOOP-17688
Project: Hadoop Common
Issue Type: Bug
Components: tools
Reporter: Error Reporter
Hello,
Our code analyses found the following potential NPE:
{code:java}
private static Object process(Object obj, Class<?> type) {
if (obj == null) {
return null;
}{code}
{code:java}
public static boolean start(RootDoc root) {
System.out.println(
ExcludePrivateAnnotationsStandardDoclet.class.getSimpleName());
RootDoc excludedDoc = RootDocProcessor.process(root);
if (excludedDoc.specifiedPackages().length == 0) { // NPE
return true;
}
{code}
Full Trace:
1. Return null to caller
https://github.com/apache/hadoop/blob/f40e3eb0590f85bb42d2471992bf5d524628fdd6/hadoop-common-project/hadoop-annotations/src/main/java/org/apache/hadoop/classification/tools/RootDocProcessor.java#L61
2. Return the return value of function process to caller
https://github.com/apache/hadoop/blob/f40e3eb0590f85bb42d2471992bf5d524628fdd6/hadoop-common-project/hadoop-annotations/src/main/java/org/apache/hadoop/classification/tools/RootDocProcessor.java#L56
3. Function process executes and stores the return value to excludedDoc (excludedDoc can be null)
https://github.com/apache/hadoop/blob/f40e3eb0590f85bb42d2471992bf5d524628fdd6/hadoop-common-project/hadoop-annotations/src/main/java/org/apache/hadoop/classification/tools/ExcludePrivateAnnotationsStandardDoclet.java#L41
4. excludedDoc is passed as the this pointer to function com.sun.javadoc.RootDoc.specifiedPackages (excludedDoc can be null)
https://github.com/apache/hadoop/blob/f40e3eb0590f85bb42d2471992bf5d524628fdd6/hadoop-common-project/hadoop-annotations/src/main/java/org/apache/hadoop/classification/tools/ExcludePrivateAnnotationsStandardDoclet.java#L42
Commit: f40e3eb0590f85bb42d2471992bf5d524628fdd6
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-dev-help@hadoop.apache.org