java --dry-run should not cause main class be initialized

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 9
    • Component/s: tools
    • None
    • b126
    • Verified

      public class Test {
         static {
             System.out.println("Hello from <clinit>");
         }
         public static void main(String[] args) {
             System.out.println("Hello from main()");
         }
      }

      ...when run with: "java -cp . Test", produces the following:

      Hello from <clinit>
      Hello from main()

      ...but when run with: "java --dry-run -cp . Test", it still produces the following:

      Hello from <clinit>

            Assignee:
            Mandy Chung (Inactive)
            Reporter:
            Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: