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

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • 9
    • Affects Version/s: 6
    • Component/s: 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.
      --

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: