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

Compiler fails to detect nonexistent package with name differing only by case

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P4
    • None
    • 1.3.0
    • tools
    • generic
    • generic

    Description

      The following illegal program is accepted by javac:

      import java.awt.Event.*;
      public class Foo {}

      This example is similar to the following legal program:

      import java.awt.event.*;
      public class Foo {}

      Note that there does exist a package 'java.awt.event', but not
      a package 'java.awt.Event'. It is significant that there exists
      a *class* named 'java.awt.Event' -- similar programs for which this
      is not the case are properly rejected (see 257802).

      If event/Event is replace by font/Font or color/Color, the bug is
      also observed.

      A similar example also appeared in bug 4180228. There, the problem
      in JDK 1.1 was specific to the win32 platform and was not observed
      when the core classes were obtained from a .zip file, indicating that
      the problem there was related to case-insensitive filesystem name
      lookup on win32. In the present case, the problem is observed on both
      win32 and Solaris, whether the core classes are in a .jar archive or
      the host filesystem.

      william.maddox@Eng 2000-02-01

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: