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

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

XMLWordPrintable

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

      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

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

              Created:
              Updated:
              Resolved: