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

(cal) RFE: Support builder for constructing Calendar

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 8
    • 1.4.0
    • core-libs
    • b75
    • generic
    • generic

    Description



      Name: gm110360 Date: 09/11/2002


      FULL PRODUCT VERSION :
      java version "1.4.1-rc"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b19)
      Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows XP [Version 5.1.2600]

      ADDITIONAL OPERATING SYSTEMS :
      All.


      A DESCRIPTION OF THE PROBLEM :
      Yes, I know about 4160136, and that it was closed.

      I'm reopening this with a request for one of two resolutions:

      (a) Either a Calendar constructor with a Date parameter, OR
      (b) a setTime(Date) that returns a Calendar (instead of
      void), OR
      (c) a setDate(Date) that returns a Calendar.

      The problem today is that it's not possible to construct a
      Calendar with a time in it, in one expression. This sort of
      operation is needed for working with JAX/RPC, which favors
      Calendar as the type for the Date/Time type.

      It would be really nice to say

         ...(..., Calendar.getInstance().setTime(new Date()), ...);

      as a single expression to pass to a JAX/RPC stub API, but
      you can't do that today: You have to make a 3-step operation

         Calendar temp = Calendar.getInstance();
         temp.setTime(new Date());
         ...(..., temp, ...)

      Any of the above 3 solutions would make this less clumsy to
      write.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See description.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected: some way to create and set a time in a Calendar in
      one expression.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER WORKAROUND :
      See description: create a Calendar, assign to a temp, set
      the time in the temp, and use the temp in an expression.
      (Review ID: 164308)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              okutsu Masayoshi Okutsu
              gmanwanisunw Girish Manwani (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: