[ 
https://issues.apache.org/jira/browse/YARN-2939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Li Lu updated YARN-2939:
------------------------
    Attachment: YARN-2939-121614.patch

Hi [~djp], thanks for your review! I've addressed your comments in this new 
patch. Specifically:

bq. {code}
+  <!-- Ignore unrelated URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD warnings -->
+  <Match>
+    <Class 
name="org.apache.hadoop.yarn.client.api.impl.TimelineClientImpl$TimelineClientConnectionRetry"
 />
+    <Field name="retried" />
+    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
+  </Match>
+
+  <Match>
+    <Class 
name="org.apache.hadoop.yarn.nodelabels.CommonNodeLabelsManager$Label" />
+    <Field name="resource" />
+    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
+  </Match>
{code}]
I added getters for the two previously exempted public fields, and then make 
them private. 

bq. {code}
+  <Match>
+    <Class name="org.apache.hadoop.yarn.nodelabels.NodeLabelsStore" />
+    <Field name="conf" />
+    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
+  </Match>
+
+  <Match>
+    <Class name="org.apache.hadoop.yarn.util.ResourceCalculatorPlugin" />
+    <Field name="processPid" />
+    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
+  </Match>
{code}
I removed two previously exempted public fields, because after a careful check 
I found they are never used. 

bq. {code}
-      sb.append(String.format("graph [ label=%s, fontsize=24, 
fontname=Helvetica];\n",
+      sb.append(String.format("graph [ label=%s, fontsize=24, 
fontname=Helvetica];%n",
          wrapSafeString(name)));
      sb.append("node [fontsize=12, fontname=Helvetica];\n");
      sb.append("edge [fontsize=9, fontcolor=blue, fontname=Arial];\n");
{code}
bq. Why we need this change for this JIRA? If we want it to be portable to 
other platforms, we should also do the similar thing for code below and should 
do it separately.

I make this change because findbugs was complaining about the '\n' used in the 
format string (it's a findbugs warning). I agree this would only partially 
solve the cross-platform, but maybe we want to track the progress of this in a 
separate JIRA. For now, I'm mainly fixing the warning. 

> Fix new findbugs warnings in hadoop-yarn-common
> -----------------------------------------------
>
>                 Key: YARN-2939
>                 URL: https://issues.apache.org/jira/browse/YARN-2939
>             Project: Hadoop YARN
>          Issue Type: Improvement
>            Reporter: Varun Saxena
>            Assignee: Li Lu
>              Labels: findbugs
>         Attachments: YARN-2939-120914.patch, YARN-2939-121614.patch
>
>




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

Reply via email to