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

javac compiles inner classes in local blocks incorrectly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 1.2.0
    • 1.1, 1.1.4, 1.2.0
    • tools
    • 1.2beta2
    • generic, sparc
    • generic, solaris_2.5.1
    • Not verified



      Name: mc57594 Date: 03/10/97


      javac successfully compiles the following code even though a
      class named "foo" is nested in another class named "foo."
      (Acutally, javac only generate class file for one of the "foo"
      classes.)

      Executing the program would result in run time error.

      ------------------------
      public class TestNested {
        public static void main(String[] args) {
          class foo {
            class foo {
              void printMsg() { System.out.println("howdy"); }
            }
            void printMsg() {
              foo foo1 = new foo();
              foo1.printMsg();
              System.out.println("Hello");
            }
          }
          foo foo1 = new foo();
          foo1.printMsg();
        }
      }
      company - University of California, Irvine , email - ###@###.###
      ======================================================================

            wmaddoxsunw William Maddox (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: