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

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

    XMLWordPrintable

Details

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

    Description

      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);
          }
      }

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: