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

UUID.randomUUID() makes an unnecessary call to the UUID constructor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • x86
    • linux, windows_xp

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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      There is a minor performance bug in Sun's implementation of java.util.UUID.randomUUID(). Here are the last two lines of this method:

              UUID result = new UUID(randomBytes);
              return new UUID(randomBytes);

      The UUID constructed by the first line is never used. This line is unnecessary.


      REPRODUCIBILITY :
      This bug can be reproduced always.
      ###@###.### 10/14/04 22:47 GMT

            iris Iris Clark
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: