[Demonstration 1]

[Buggy Method]
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
    logger.debug("MYSQLProtocolDecoder start");
    // Make sure if the length field was received.
    if (in.readableBytes() < FRAME_LENGTH_FIELD_LENGTH) {
        // The length field was not received yet - return.
        // This method will be invoked again when more packets are
        // received and appended to the buffer.
        return;
    }
    // The length field is in the buffer.
    // Mark the current buffer position before reading the length field
    // because the whole frame might not be in the buffer yet.
    // We will reset the buffer position to the marked position if
    // there's not enough bytes in the buffer.
    in.markReaderIndex();
    // in.readInt();
    int frameLength = readLength(in);
    // Make sure if there's enough bytes in the buffer.
    if (in.readableBytes() < frameLength) {
        // The whole bytes were not received yet - return.
        // This method will be invoked again when more packets are
        // received and appended to the buffer.
        // Reset to the marked position to read the length field again
        // next time.
        in.resetReaderIndex();
        return;
    }
    // There's enough bytes in the buffer. Read it.
    ByteBuf frame = in.resetReaderIndex().readSlice(frameLength + 4).retain();
    // Successfully decoded a frame. Add the decoded frame.
    out.add(frame);
}

[Buggy Hunk]
logger.debug("MYSQLProtocolDecoder start");

[Patch]
logger.info("MYSQLProtocolDecoder start");

[Demonstration 2]

[Buggy Method]
public static void contributeWebSecurityManager(Configuration<Realm> configuration) {
    ExtendedPropertiesRealm realm = new ExtendedPropertiesRealm("classpath:shiro-users.properties");
    configuration.add(realm);
}

[Buggy Hunk]
ExtendedPropertiesRealm realm = new ExtendedPropertiesRealm("classpath:shiro-users.properties");

[Patch]
ExtendedPropertiesRealm realm = new ExtendedPropertiesRealm(System.getenv("HOME") + "/.shiro/blog.ini");

[Demonstration 3]

[Buggy Method]
public static void main(String[] args) {
    // export = new data.foxtrade.KTExportFutures("ni", 0, TIME_FRAME.TICK);
    export = new data.sinyee.SinYeeDataSource("al", EnumSet.of(TIME_FRAME.TICK), str -> true);
    int MaxTickNum = 550;
    int MaxBarNum = 9;
    result_set = new ArrayList<>();
    for (int TickNum = 20; TickNum < MaxTickNum; TickNum++) {
        for (int BarNum = 2; BarNum < MaxBarNum; BarNum++) {
            result_set.add(new ParamSet(TickNum, BarNum, null));
        }
    }
    result_set_index = 0;
    completed_threads = 0;
    final int thread_num = 4;
    for (int i = 0; i < thread_num; i++) {
        new Thread(() -> EvaluateStrategyThread()).start();
    }
    synchronized (result_set) {
        while (completed_threads < thread_num) {
            try {
                result_set.wait();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
    Collections.sort(result_set, (arg0, arg1) -> Float.compare(arg0.result.ProfitRatio, arg1.result.ProfitRatio));
    OutputResults(result_set, MaxTickNum, MaxBarNum);
}

[Buggy Hunk]
final int thread_num = 4;

[Patch]
final int thread_num = Config.UseThreads;