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

Cannot access complete() method in GregorianCalendar without subclassing

XMLWordPrintable

    • generic
    • solaris_2.5.1

      jdk1.1beta3

      java.util.Calendar has a method: complete() which the documentation implies
      is used to complete the time fields within the Calendar object once some
      key instance variables have been set. However, the method is protected,
      as are the two methods it calls: computeTime() and computeFields(), so they
      can only be called from an object which subclasses Calendar (or one of its
      subclasses).

      I want to create an instance of a GregorianCalendar without subclassing it,
      in which I set the year, month and date, from which I can then retrieve the
      day of week etc. There seems to be no way to do this without calling complete()
      - which means subclassing the GregorianCalendar.

            bcbeck Brian Beck (Inactive)
            twatson Trevor Watson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: