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

compiler error in DU of assert arg2 when arg1 is true

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: specification
    • Subcomponent:
    • CPU:
      generic
    • OS:
      solaris_8

      Description

      Detected by jikes non-jls-jsr41.4-definite-unassignment-try-9

      frog:~/workspaces/test/jikes $ cat -n T.java
           1 class T {
           2 public static void main(String[] args) {
           3 final boolean b;
           4 try {
           5 throw new RuntimeException();
           6 } catch (RuntimeException e) {
           7 assert true : b = true;
           8 } finally {
           9 b = false;
          10 }
          11 }
          12 }
      frog:~/workspaces/test/jikes $ newjavac -source 1.4 T.java
      T.java:9: variable b might already have been assigned to
                  b = false;
                  ^
      1 error
      frog:~/workspaces/test/jikes $

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              abuckley Alex Buckley
              Reporter:
              gafter Neal Gafter
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: