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

Strange code in JavacParser.java

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 17
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b26

      Description

      Parser.java contains the following at line 2206:

      {code}
      if (token.kind == RBRACKET) {
          elemtype = bracketsOptCont(elemtype, pos, maybeDimAnnos);
      } else {
          if (token.kind == RBRACKET) { // no dimension
              elemtype = bracketsOptCont(elemtype, pos, maybeDimAnnos);
          } else {
              dimAnnotations.append(maybeDimAnnos);
              dims.append(parseExpression());
              accept(RBRACKET);
          }
      }
      {code}

      It seems that the inner if is always false.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jlahoda Jan Lahoda
              Reporter:
              emc Eric Mccorkle
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: