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

Improve error recovery

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 22, 23
    • tools
    • None
    • b13

      In some cases, there are some extraneous error messages when an opening brace is missing. Error recovery could be improved to reduce the number of error messages for a single syntax error.

      i.e. - in JDK 22, the following missing open brace on a method generates 4 error messages, one more than with JDK 21.

      package tests; // TestB.java:1: error: implicitly declared class should not have package declaration
      public class TestB {
          public static boolean test() // <--- missing open brace
              return true;
          }
          public static boolean test2() {
              return true;
          }
      }

        1. proposedchange.patch
          2 kB
          Michel Trudeau
        2. TestB.java
          0.3 kB
          Michel Trudeau

            jlahoda Jan Lahoda
            mtrudeau Michel Trudeau
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: