&& d.supportsPatch(patchString, pk.getByteArray())) {
&& d.supportsPatch(patchString, sysex)) {
    private IPatch fixPatch(Patch pk, String patchString) {        for (int i = 0; i < AppConfig.deviceCount(); i++) {            // first check the requested device.            // then starting index '1'. (index 0 is 'generic driver')            // XXX pk.getDevice() -> getDevice()?            Device device = (i == 0) ? pk.getDevice() : AppConfig.getDevice(i);            for (int j = 0; j < device.driverCount(); j++) {                IDriver d = device.getDriver(j);                if (d instanceof Driver                        && d.supportsPatch(patchString, pk.getByteArray())) {                    // driver found                    Driver driver = (Driver) d;                    pk.setDriver(driver);                    driver.trimSysex(pk);                    JOptionPane                            .showMessageDialog(null, "You requested a "                                    + driver.toString() + " patch!"                                    + "\nBut you got a "                                    + pk.getDriver().toString() + " patch.",                                    "Warning", JOptionPane.WARNING_MESSAGE);                    return pk;                }            } // end of driver (j) loop        } // end of device (i) loop        // driver not found        pk.setDriver(null); //reset        pk.setComment("Probably a "                + pk.lookupManufacturer()                + " Patch, Size: " + pk.getByteArray().length);        JOptionPane.showMessageDialog(null, "You requested a "                + this.toString() + " patch!"                + "\nBut you got a not supported patch!\n" + pk.getComment(),                "Warning", JOptionPane.WARNING_MESSAGE);        return pk;    }