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

1.5.0 REGRESSION: javac gives a bad error message, which is confusing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • tools
    • b40
    • x86
    • windows_nt

      Consider the following test case, with a bogus symbol in it:

      import javax.swing.*;

      public class MesgTest{
          public static void main(String[] args) {
              JButton b = new JButton();
              b.setSelected(BOGUS);
          }
      }

      When I compile it under 1.4.2 I get 1 error message (as expected):
      MesgTest.java:6: cannot resolve symbol
      symbol : variable BOGUS
      location: class MesgTest
              b.setSelected(BOGUS);
                            ^
      1 error

      When I compile it under 1.5.0 I get the following 2 errors:

      MesgTest.java:6: cannot find symbol
      symbol : variable BOGUS
      location: class MesgTest
              b.setSelected(BOGUS);
                            ^
      MesgTest.java:6: internal error; cannot instantiate setSelected(boolean) at java
      x.swing.JButton to (BOGUS)
              b.setSelected(BOGUS);
               ^
      2 errors

      The second error message makes absolutely no sense to me, and I believe it will cause confusion.

      I have inquired about this to a couple of people, and a response from ###@###.### indicates that this is a bug.

            gafter Neal Gafter (Inactive)
            shickeysunw Shannon Hickey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: