Browse Source

YARN-11734. Fix spotbugs in ServiceScheduler#load (#7088) Contributed by Hualong Zhang.

Reviewed-by: Shilun Fan <slfan1989@apache.org>
Signed-off-by: Shilun Fan <slfan1989@apache.org>
zhtttylz 8 months ago
parent
commit
b781882020

+ 0 - 8
hadoop-yarn-project/hadoop-yarn/dev-support/findbugs-exclude.xml

@@ -726,12 +726,4 @@
     <Package name="org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.placement.schema" />
   </Match>
 
-  <!-- The ServiceScheduler#createConfigFileCache method uses the `load` method,
-       which is not allowed to return null; we can ignore it here. -->
-  <Match>
-    <Class name="org.apache.hadoop.yarn.service.ServiceScheduler"/>
-    <Method name="$1.load(ConfigFile)" />
-    <Bug pattern="NP_NONNULL_RETURN_VIOLATION"/>
-  </Match>
-
 </FindBugsFilter>

+ 5 - 0
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/dev-support/findbugs-exclude.xml

@@ -56,4 +56,9 @@
       </Or>
       <Bug pattern="SE_BAD_FIELD" />
   </Match>
+  <Match>
+      <Class name="org.apache.hadoop.yarn.service.ServiceScheduler$1"/>
+      <Method name="load"/>
+      <Bug code="NP" pattern="NP_NONNULL_RETURN_VIOLATION"/>
+  </Match>
 </FindBugsFilter>