hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhijie Shen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-2938) Fix new findbugs warnings in hadoop-yarn-resourcemanager and hadoop-yarn-applicationhistoryservice
Date Fri, 12 Dec 2014 03:50:14 GMT

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

Zhijie Shen commented on YARN-2938:
-----------------------------------

1. After the change, the method will always create a policy obj, right? However, before the
change, the policy obj is only created when it is not in instances.
{code}
-    SchedulingPolicy policy = instances.get(clazz);
-    if (policy == null) {
-      policy = ReflectionUtils.newInstance(clazz, null);
-      instances.put(clazz, policy);
+    SchedulingPolicy policy = ReflectionUtils.newInstance(clazz, null);
+    SchedulingPolicy policyRet = instances.putIfAbsent(clazz, policy);
+    if(policyRet != null) {
+      return policyRet;
{code}

2. Is the newly adde entries in {{findbugs-exclude.xml}} fixable? Would you mind sharing the
detail findbugs reports about these issues?

> Fix new findbugs warnings in hadoop-yarn-resourcemanager and hadoop-yarn-applicationhistoryservice
> --------------------------------------------------------------------------------------------------
>
>                 Key: YARN-2938
>                 URL: https://issues.apache.org/jira/browse/YARN-2938
>             Project: Hadoop YARN
>          Issue Type: Improvement
>            Reporter: Varun Saxena
>            Assignee: Varun Saxena
>             Fix For: 2.7.0
>
>         Attachments: YARN-2938.001.patch, YARN-2938.002.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message