[Demonstration 1]

[Buggy Method]
private UpdateResult updateSqlFields(String spaceName, PreparedStatement stmt, SqlFieldsQuery fieldsQry, boolean loc, IndexingQueryFilter filters, GridQueryCancel cancel) throws IgniteCheckedException {
    Object[] errKeys = null;
    long items = 0;
    UpdatePlan plan = getPlanForStatement(spaceName, stmt, null);
    GridCacheContext<?, ?> cctx = plan.tbl.rowDescriptor().context();
    for (int i = 0; i < DFLT_DML_RERUN_ATTEMPTS; i++) {
        CacheOperationContext opCtx = cctx.operationContextPerCall();
        // Force keepBinary for operation context to avoid binary deserialization inside entry processor
        if (cctx.binaryMarshaller()) {
            CacheOperationContext newOpCtx = null;
            if (opCtx == null)
                // Mimics behavior of GridCacheAdapter#keepBinary and GridCacheProxyImpl#keepBinary
                newOpCtx = new CacheOperationContext(false, null, true, null, false, null);
            else if (!opCtx.isKeepBinary())
                newOpCtx = opCtx.keepBinary();
            if (newOpCtx != null)
                cctx.operationContextPerCall(newOpCtx);
        }
        UpdateResult r;
        try {
            r = executeUpdateStatement(cctx, stmt, fieldsQry, loc, filters, cancel, errKeys);
        } finally {
            cctx.operationContextPerCall(opCtx);
        }
        items += r.cnt;
        errKeys = r.errKeys;
        if (F.isEmpty(errKeys))
            break;
    }
    if (F.isEmpty(errKeys)) {
        if (items == 1L)
            return UpdateResult.ONE;
        else if (items == 0L)
            return UpdateResult.ZERO;
    }
    return new UpdateResult(items, errKeys);
}

[Buggy Hunk]
newOpCtx = new CacheOperationContext(false, null, true, null, false, null);

[Patch]
newOpCtx = new CacheOperationContext(false, null, true, null, false, null, false);

[Demonstration 2]

[Buggy Method]
public void robotInit() {
    System.out.println("robotInit");
    Double[] D = { 1.0, 2., 3. };
    System.out.println("Robot - 34");
    dASet = new Set<Double[]>("Table", "Name1", D);
    System.out.println("Robot - #" + cpi.tools.SetBase.lineNumber());
    System.out.println("dASet= (" + dASet.Value()[0] + ", " + dASet.Value()[1] + ", " + dASet.Value()[1] + ")");
    Double Di = 5.;
    dSet = new Set<Double>("Table", "Name2", Di);
    System.out.println("dSet=" + dSet.Value(10.));
    System.out.println("End robotInit");
}

[Buggy Hunk]
System.out.println ("Robot - 34");

[Patch]
System.out.println ("Robot - #"+cpi.tools.SetBase.lineNumber());

[Demonstration 3]

[Buggy Method]
@Test
public void testAddScore() {
    PersonDTO p = personService.findPerson(2);
    EntryDTO e = entryService.findEntry(102);
    System.out.println(p.getFirstName() + ": " + p.getScore());
    System.out.println("Adding score.......");
    scoreService.addScore(e);
    System.out.println("New score: " + p.getScore());
}

[Buggy Hunk]
System.out.println("New score: " + p.getScore());

[Patch]
System.out.println("New score: " + personService.findPerson(2).getScore());