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

javac is incorrectly implementing the DA/DU rules for for-loops

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P4
    • None
    • None
    • tools
    • None

    Description

      This test case:

      public class Sample1 {
          final int x;

          Sample1() {
               for(;;x=1) {
                   x=2;
                   break;
               }
           }
      }

      is rejected by javac but should be accepted. See the discussion here [1]

      [1] http://mail.openjdk.java.net/pipermail/compiler-dev/2018-February/011646.html

      Attachments

        Issue Links

          Activity

            People

              vromero Vicente Arturo Romero Zaldivar
              vromero Vicente Arturo Romero Zaldivar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: