nijel created HDFS-8526:
---------------------------

             Summary: "final" behavior is not honored for 
YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH  since it is a String[]
                 Key: HDFS-8526
                 URL: https://issues.apache.org/jira/browse/HDFS-8526
             Project: Hadoop HDFS
          Issue Type: Bug
            Reporter: nijel
            Assignee: nijel


i was going through some find bugs rules. One issue reported in that is 

 public static final String[] DEFAULT_YARN_APPLICATION_CLASSPATH = {
and 
  public static final String[] 
DEFAULT_YARN_CROSS_PLATFORM_APPLICATION_CLASSPATH=

is not honoring the final qualifier. The string array contents can be re 
assigned !
Simple test
{code}
public class TestClass {
  static final String[] t = { "1", "2" };
  public static void main(String[] args) {
    System.out.println(12 < 10);
    String[] t1={"u"};
//    t = t1; // this will show compilation 
    t (1) = t1 (1) ; // But this works

  }
}
{code}
One option is to use Collections.unmodifiableList

any thoughts ?



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

Reply via email to