[Demonstration 1]

[Buggy Method]
@Override
public List<Class<?>> getInfrastructureClasses() {
    return Arrays.asList(GitRepository.class);
}

[Buggy Hunk]
return Arrays.asList(GitRepository.class);

[Patch]
return new ClassList(GitRepository.class);

[Demonstration 2]

[Buggy Method]
@Override
public void onCallStateChanged(int state, String incomingNumber) {
    //                if (incomingNumber == null) {
    //                    return;
    //                }
    lastCreateTime = System.currentTimeMillis();
    switch(state) {
        case TelephonyManager.CALL_STATE_RINGING:
            //                        singleCallState = true;
            Log.d("phonelistener_tag", "RINGING");
            this.incomingNumber = incomingNumber;
            break;
        case TelephonyManager.CALL_STATE_OFFHOOK:
            //                        long current = System.currentTimeMillis();
            startTime = System.currentTimeMillis();
            if (this.incomingNumber == null) {
                return;
            }
            Log.i("phonelistener_tag", "current: " + System.currentTimeMillis());
            Log.i("phonelistener_tag", "lastCreateTime: " + lastCreateTime);
            //                        if (current-lastCreateTime < 1000 && current!=lastCreateTime) {
            //                            return;
            //                        }
            Log.d("phonelistener_tag", "OFFHOOK, incomingNumber: " + this.incomingNumber);
            //                        if (singleCallState) {
            Toast.makeText(context, "正在录音。。。", Toast.LENGTH_SHORT).show();
            String filename = System.currentTimeMillis() + ".3gp";
            file = new File(root.getAbsoluteFile(), filename);
            try {
                mediaRecorder = new MediaRecorder();
                mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
                mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
                mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
                mediaRecorder.setOutputFile(file.getAbsolutePath());
                mediaRecorder.prepare();
                mediaRecorder.start();
            } catch (Exception e) {
                e.printStackTrace();
            }
            //                        }
            break;
        case TelephonyManager.CALL_STATE_IDLE:
            Log.d("phonelistener_tag", "IDLE");
            //                        singleCallState = true;
            if (mediaRecorder != null) {
                try {
                    mediaRecorder.stop();
                    mediaRecorder.release();
                    mediaRecorder = null;
                    endTime = System.currentTimeMillis();
                    Calllog calllog = new Calllog(this.incomingNumber, startTime, endTime - startTime, file.getName());
                    Log.i("phonelistener_tag", "begin to insert...");
                    long rowId = calllogDao.insert(calllog);
                    Log.i("phonelistener_tag", "insert over, rowId: " + rowId);
                    Toast.makeText(context, "录音结束，文件保存至：" + file.getAbsolutePath(), Toast.LENGTH_SHORT).show();
                    //                            files = root.list();
                    //                            lv_files.deferNotifyDataSetChanged();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            break;
    }
}

[Buggy Hunk]
String filename = System.currentTimeMillis() + ".3gp";

[Patch]
String filename = PhoneReceiver.currentTimeMillis + ".3gp";

[Demonstration 3]

[Buggy Method]
public static void distributeResources(Configuration yarnConf, Properties appConf, String appName) throws IOException {
    final FileSystem distFs = FileSystem.get(yarnConf);
    //distribute configuration
    final Path dstConfig = new Path(distFs.getHomeDirectory(), appName + ".configuration");
    final FSDataOutputStream fs = distFs.create(dstConfig);
    appConf.store(fs, "Yarn1 Application Config");
    fs.close();
    log.info("Updated resource " + dstConfig);
    //distribute main jar
    final String localPath = YarnClient.class.getProtectionDomain().getCodeSource().getLocation().getFile().replace(".jar/", ".jar");
    final Path src;
    final String jarName = appName + ".jar";
    if (localPath.endsWith(".jar")) {
        log.info("Distributing local jar : " + localPath);
        src = new Path(localPath);
    } else {
        String localArchive = localPath + appName + ".jar";
        log.info("Archiving and distributing local classes from current working directory " + localArchive);
        try {
            String archiveCommand = "jar cMf " + localArchive + " -C " + localPath + " ./";
            FileSystem.getLocal(yarnConf).delete(new Path(localArchive), false);
            Process archivingProcess = Runtime.getRuntime().exec(archiveCommand);
            if (archivingProcess.waitFor() != 0) {
                throw new IOException("Failed to executre tar -C command on: " + localPath);
            }
            src = new Path(localArchive);
        } catch (InterruptedException e) {
            throw new IOException(e);
        }
    }
    //distribute jar
    final Path dst = new Path(distFs.getHomeDirectory(), jarName);
    log.info("Updating resource " + dst + " ...");
    distFs.copyFromLocalFile(false, true, src, dst);
    FileStatus scFileStatus = distFs.getFileStatus(dst);
    log.info("Updated resource " + dst + " " + scFileStatus.getLen());
}

[Buggy Hunk]
appConf.store(fs, "Yarn1 Application Config");

[Patch]
appConf.store(fs, "Yarn1 Application Config for " + appName);