[Demonstration 1]

[Buggy Method]
public int getRowCount(SQLDataSetDef def) throws Exception {
    DataSource ds = dataSourceLocator.lookup(def);
    Connection conn = ds.getConnection();
    try {
        return _getRowCount(def, conn);
    } finally {
        conn.close();
    }
}

[Buggy Hunk]
return _getRowCount(def, conn);

[Patch]
return _getRowCount(def, conn, false);

[Demonstration 2]

[Buggy Method]
public static final CustomField getCustomField(Map<String, Object> map) {
    CustomField customField = null;
    if (map != null && map.size() > 0) {
        // Sometimes we are working with CFs without ID
        customField = new CustomField();
        customField.setId(getInteger(map, TestLinkResponseParams.ID.toString()));
        customField.setDefaultValue(getString(map, TestLinkResponseParams.DEFAULT_VALUE.toString()));
        customField.setDisplayOrder(getInteger(map, TestLinkResponseParams.DISPLAY_ORDER.toString()));
        customField.setEnableOnDesign(getBoolean(map, TestLinkResponseParams.ENABLE_ON_DESIGN.toString()));
        customField.setEnableOnExecution(getBoolean(map, TestLinkResponseParams.ENABLE_ON_EXECUTION.toString()));
        customField.setEnableOnTestPlanDesign(getBoolean(map, TestLinkResponseParams.ENABLE_ON_TEST_PLAN_DESIGN.toString()));
        customField.setLabel(getString(map, TestLinkResponseParams.LABEL.toString()));
        customField.setLengthMax(getInteger(map, TestLinkResponseParams.LENGTH_MAX.toString()));
        customField.setLengthMin(getInteger(map, TestLinkResponseParams.LENGTH_MIN.toString()));
        customField.setLocation(getInteger(map, TestLinkResponseParams.LOCATION.toString()));
        customField.setName(getString(map, TestLinkResponseParams.NAME.toString()));
        customField.setPossibleValues(getString(map, TestLinkResponseParams.POSSIBLE_VALUES.toString()));
        customField.setShowOnDesign(getBoolean(map, TestLinkResponseParams.SHOW_ON_DESIGN.toString()));
        customField.setShowOnExecution(getBoolean(map, TestLinkResponseParams.SHOW_ON_EXECUTION.toString()));
        customField.setShowOnTestPlanDesign(getBoolean(map, TestLinkResponseParams.SHOW_ON_TEST_PLAN_DESIGN.toString()));
        customField.setType(getInteger(map, TestLinkResponseParams.TYPE.toString()));
        customField.setValidRegexp(getString(map, TestLinkResponseParams.VALID_REGEXP.toString()));
        customField.setValue(getString(map, TestLinkResponseParams.VALUE.toString()));
    }
    return customField;
}

[Buggy Hunk]
public static final CustomField getCustomField(Map<String, Object> map) {

[Patch]
public static CustomField getCustomField(Map<String, Object> map) {

[Demonstration 3]

[Buggy Method]
public void edit(Group group) {
    editorDriver.edit(group);
    nameEditor.setValue(group.getSubjectDisplayName());
}

[Buggy Hunk]
nameEditor.setValue(group.getSubjectDisplayName());

[Patch]
nameEditor.setValue(group.getGroupShortName());