JDK-4816363 : ShortMessage.getMessage() from external device lacks one byte
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2003-02-11
  • Updated: 2003-07-21
  • Resolved: 2003-07-21
Related Reports
Duplicate :  
Description

Name: fb126949			Date: 02/10/2003


When receiving MIDI data from an external device, the ShortMessage instances return an array in getMessage() that has one byte fewer elements than the length of the actual message. Also getLength() returns one too small.


======================================================================

Comments
WORK AROUND Use getStatus(), getData1() and getData2() instead of getMessage(). This has the additional benefit of higher performance, since getMessage() allocates a new array each time it is called.
11-06-2004

SUGGESTED FIX in FastShortMessage.getMessage(): length = getLength(); // instead of getDataLength() in FastShortMessage.getLength(): add 1 to returned value.
11-06-2004

EVALUATION ###@###.### 2003-02-10 Small bug, cause known.
10-02-2003