[Demonstration 1]

[Buggy Method]
public static String parseCharset(String contentType) {
    for (String part : contentType.split(";")) {
        if (part.trim().startsWith("charset=")) {
            String[] val = part.split("=");
            if (val[1].length > 1) {
                return val[1].trim();
            }
        }
    }
    return null;
}

[Buggy Hunk]
if (val[1].length > 1) {

[Patch]
if (val.length > 1) {

[Demonstration 2]

[Buggy Method]
public static String createIssue(JiraIssueDTO issue) throws JiraIntegrationServiceException {
    logger.info(String.format(" CreateIssue. Object received : %s ", new Gson().toJson(issue, JiraIssueDTO.class)));
    if (!url.isEmpty() && creds != null) {
        String projectName = "";
        if (issue.getProject() == null || issue.getProject().isEmpty()) {
            projectName = project;
        } else {
            projectName = issue.getProject();
        }
        try {
            jira = new JiraClient(url, creds);
            logger.trace(String.format("Connect to Url : %s . TxId : %s", url, issue.getTransactionId()));
            Issue newIssue = jira.createIssue(projectName, EIssueType.STORY.getNameProperty()).field(Field.SUMMARY, issue.getAction()).field(Field.DESCRIPTION, issue.getDescription()).field(Field.REPORTER, user).field(Field.ASSIGNEE, user).execute();
            logger.info(String.format("Issue No. %s was create .Txid : %s", newIssue.getId(), issue.getTransactionId()));
            return newIssue.getId();
        } catch (JiraException e) {
            logger.error("Error returned by Jira Client . TxId : " + issue.getTransactionId(), e);
            throw new JiraIntegrationServiceException("Error in Jira Client", e);
        }
    } else {
        logger.error("Jira configuration not found. TxId " + issue.getTransactionId());
        throw new JiraIntegrationServiceException(" Jira Configuration not found.");
    }
}

[Buggy Hunk]
return newIssue.getId();

[Patch]
return newIssue.getKey();

[Demonstration 3]

[Buggy Method]
private boolean isOnTime(Issue issue) {
    return issue.getDueDate() != null && issue.getResolutionDate() != null && (issue.getResolutionDate().getTime() - issue.getDueDate().getTime() < 3600);
}

[Buggy Hunk]
return issue.getDueDate() != null && issue.getResolutionDate() != null && (issue.getResolutionDate().getTime() - issue.getDueDate().getTime() < 3600);

[Patch]
return (issue.getDueDate() != null && issue.getResolutionDate() != null && (issue.getResolutionDate().getTime() - issue.getDueDate().getTime() < 3600)) || (issue.getDueDate() == null && issue.getResolutionDate() == null);