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

Object methods are not forwarded for custom Receiver and Transmiter

    Details

      Description

      PRECONDITION

      1. A MidiDevice providing the default Receiver (or Transmitter) is supplied via the service provider interface (using javax.sound.midi.spi.MidiDeviceProvider).
      2. The Receiver (or Transmitter) does not implement MidiDeviceReceiver (or MidiDeviceTransmitter).
      3. The Receiver (or Transmitter) implementation overrides methods from java.lang.Object.

      PROBLEM

        System.setProperty("javax.sound.midi.Receiver", /* Our receiver */);
        Receiver receiver = MidiSystem.getReceiver();

        // THESE METHODS ARE NOT INVOKED FROM THE RECEIVER IMPLEMENTATION!
        receiver.toString();
        receiver.equals();
        receiver./* Any other method from java.lang.Object */


      INITIAL ANALYSIS

      From the RI code:
          public static Receiver getReceiver() throws MidiUnavailableException {
              // . . .
              if (!(receiver instanceof MidiDeviceReceiver)) {
                  receiver = new MidiDeviceReceiverEnvelope(device, receiver);
              }
              return receiver;
          }
      It looks like MidiDeviceReceiverEnvelope does not forward java.lang.Object methods to veritable receiver.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                amenkov Alex Menkov
                Reporter:
                ashusher Alexander Shusherov (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: