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

Class.getDeclaredFields() occasionally returns null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.1.6
    • core-libs
    • None

      According to the JavaDoc for JDK1.1.6, Class::getDeclaredFields() always
      returns an array. If the class or interface defines no fields, an empty array is
      returned. However, sometimes this method has been clearly observed to return
      null. The tested platform ( Windows NT V4.0 SP3, also happens on Solaris 2.5.1)

      Again, It is NOT returning an array of length 0, it is returning NULL (i.e. not returning an array of any size).

      A related issue is that when the customer sees this, the class actually DOES have fields. So there are two problems:

      1) Instead of returning an array of size 0, it returns NULL
      2) It should be returning an array of size > 0.

      The customer really isn't able to produce a "test case" per se. This failure is
      intermittent and has very low frequency, occurring say once every few hundred
      thousand calls.

            iris Iris Clark
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: