Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4642981

javac fails to disallow assignment to final parameter and final exception var

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • tools
    • None
    • generic
    • solaris_8

      The spec specifically disallows assigning to a final parameter or a final exception variable, but javac allows it in certain cases. Here is an example:

      public class T {
          public static void main(final String[] args) {
      if (true ? true : (args = null) == null);
          }
      }

            Unassigned Unassigned
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: