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

compiler error in DU of assert arg2 when arg1 is true

XMLWordPrintable

    • generic
    • solaris_8

      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 $

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: