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

compiler reports bad line number

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.1
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      1.1beta3
    • CPU:
      x86, sparc
    • OS:
      solaris_2.5, solaris_2.5.1, windows_95
    • Verification:
      Not verified

      Description

      The following file produces an error on line 16383, which is a bit wrong. The error is:

      javac -g Tree.java
      Tree.java:16383: Invalid method declaration; return type required.
       
      ^
      1 error

      -----------------------------------------------------------------------

      import java.awt.*;
       
      public class Tree extends Canvas {
          private final static int WIDTH = 300;
          private final static int HEIGHT = 500;
          private final static int BORDER = 5;
       
          private final static int MIDDLE_X = WIDTH / 2;
          private final static int MIDDLE_Y = HEIGHT / 2;
          private final static int TOP = BORDER;
          private final static int BOTTOM = HEIGHT - BORDER;
          private final static int LEFT = BORDER;
          private final static int RIGHT = WIDTH - BORDER;
       
          private static int[] topX = { MIDDLE_X, LEFT + 30, RIGHT - 30 };
          private static int[] topY = { TOP, TOP + 100, TOP + 100 };
       
          private Polygon top;
       
          Tree() {
              top = new Polygon();
              for (i = 0; i < topX.length; i++)
                  top.add(topX[i], topY[i]);
          }
       
          draw(Graphics g) {
              g.drawPolygon(top);
          }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jrose John Rose
              Reporter:
              karnoldsunw Kenneth Arnold (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: