From: Hiroo H. <hir...@co...> - 2005-04-10 05:06:13
|
Joe, As I wrote on comment, I think the lines after '// Maybe you don't get the expected path.' are used only for programming error of a Driver. My take is to remove those lines and to show an error dialog to let users send a bug report to us. On Wed, 06 Apr 2005 17:04:05 +0000 Joe Emenaker <jo...@em...> wrote: Joe> Around line 290 in Driver,java is the following method createPatches(): Joe> Joe> > public IPatch[] createPatches(SysexMessage[] msgs) { Joe> > byte[] sysex = MidiUtil.sysexMessagesToByteArray(msgs); Joe> > IPatch[] patarray = DriverUtil.createPatches(sysex, getDevice()); Joe> > Joe> > // Maybe you don't get the expected patch! Joe> > // Check all devices/drivers again! Call fixpatch() if Joe> > supportsPatch Joe> > // returns false. Joe> > // XXX Why don't we simply cause error? Hiroo Joe> > for (int k = 0; k < patarray.length; k++) { Joe> > ... Joe> Joe> Due to a mistake on my part, I made a driver which didn't recognize the Joe> sysex that I sent it. As a result, DriverUtil.createPatches() returned a Joe> null which was then assigned to patarray[]. This caused an exception Joe> when execution got to the patarray.length. Joe> Joe> I didn't want to mess with this, since I didn't write it and I'm not Joe> sure how it was intended to work. Joe> Joe> Granted, it was a bug in my driver which exposed this bug.... but I Joe> still think that this is a bug. It should handle this more gracefully. Joe> What's the preferred behavior here? Should Driver.createPatches check Joe> for a null patarray[], or should DriverUtil.createPatches be reworked so Joe> as to guarantee that it never returns a null? Joe> Joe> - Joe -- Hiroo Hayashi |