byte[] (AsmCodeGenerator codeGenerator) { byte[] patchedData = codeGenerator.getPatchedData(); FormErrorInfo[] errors = codeGenerator.getErrors(); FormErrorInfo[] warnings = codeGenerator.getWarnings(); if (errors.length == 0 && warnings.length == 0) { assertNotNull("Class patching failed but no errors or warnings were returned", patchedData); } else if (errors.length > 0) { fail(errors[0].getErrorMessage()); } else { fail(warnings[0].getErrorMessage()); } return patchedData; }