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

Compiler does not do null check on qualified new

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • tools
    • merlin
    • generic
    • generic
    • Verified

      Qualified class instance creation expressions must not be qualified by a
      null reference. It appears that the current release (1.3) is not performing the
      necessary check. This check is performed by the 1.2 compiler.

      Compile and run the following program:

      class nullQualifiedNew {

        class Nested {

          int j;
          Nested(int i){ j = i;}
        }

        public static void main(String[] args) {

          nullQualifiedNew e = null;
          e.new Nested(6);
        }
      }

      gilad.bracha@eng 2000-02-01

            busersunw Btplusnull User (Inactive)
            gbrachasunw Gilad Bracha (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: