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

Calendar.getInstance() methods should not be synchronised

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • core-libs
    • None
    • beta2
    • generic
    • generic

      michelle.devereux@Ireland 2001-06-27
      Calendar.getInstance() methods should not be synchronised as unnecessary synchronisation could block the execution of multiple threads.

      From IBM:
      >
      > "I can also see no reason why these
      > methods(Calendar.getInstance() ) are synchronised with their
      > present implementations but the intent is to return
      > something initialised to the 'present time' hence you might
      > expect an actual implementation to sample the time, create
      > some object or set of objects and then ensure that
      > everything refers to the same time. That would avoid the
      > possibility that the returned object was internally
      > inconsistent and implies the need to synchronise. I imagine
      > that's why the interface is specified as it is "
      >

            okutsu Masayoshi Okutsu
            mdevereuorcl Michelle Devereux (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: