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

Equivocal method description: javax.sound.midi.Sequencer.SyncMode.equals()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 9
    • 6
    • client-libs

      The specification for javax.sound.midi.Sequencer.SyncMode.equals says:
      --
      public final boolean equals(Object obj)
          Determines whether two objects are equal. Returns true if the objects are identical
          Overrides:
              equals in class Object
          Parameters:
              obj - the reference object with which to compare
          Returns:
              true if this object is the same as the obj argument, false otherwise
          See Also:
              Object.hashCode(), Hashtable
      --

        The description of the method does not give a univocal presentation about what objects are supposed to be equal. Let's consider the following pair of objects:

      Sequencer.SyncMode sMode1 = new MySyncMode("one");
      Sequencer.SyncMode sMode2 = new MySyncMode("one");

        The present spec can not say definitely whether these 2 objects are equal. One can argue that the following statement answers the question:
      --
      Returns:
          true if this object is the same as the obj argument, false otherwise
      --

        However "the same" can be treated in different ways. For example, see the "return" section for java.lang.Long:
      --
      Returns:
          true if the objects are the same; false otherwise.
      --

            serb Sergey Bylokhov
            ashusher Alexander Shusherov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: