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

fp.bugs<1575>minor bug in the compiler's parser

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.0beta
    • CPU:
      sparc
    • OS:
      solaris_2.3
    • Verification:
      Not verified

      Description

      <###@###.###>

      a minor bug in the compiler's parser. In particular, the positions
      of variables in a defintion such as:
      int a,b,c;
        are set incorrectly in the Field data structure created. The bug is
      in java/tools/java/Parser.java, around line 1278, at the call:

       defineField(p, doc, mod, vt, id, null, init);

      The variable p is used to keep the position of the field being
      parsed in (as opposed to the brackets or initializer), but it is not
      updated in the loop that reads in the several comma-separated variables.
      It maintains its value from earlier throughout the entire loop, and thus
      all the variables are considered to be at the same position.

      The bug can be fixed simply by adding the statement "p=pos;"
      to the top of the loop at line 1256, so that the code reads:

      // It is a list of instance variables
      while (true) {
      p=pos; // Ensure the correct p value for each variavle
      // parse the array brackets (if any)

        Attachments

          Activity

            People

            Assignee:
            fyellinsunw Frank Yellin (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: