[Demonstration 1]

[Buggy Method]
public ModuleInstallationParameters build() {
    File firstSpiritModule = new File(this.fsm);
    if (!firstSpiritModule.isFile() || !firstSpiritModule.exists()) {
        throw new IllegalArgumentException("Could not open .fsm file");
    }
    if (projectName == null || projectName.trim().length() <= 0) {
        throw new IllegalArgumentException("Project name must be set");
    }
    File projectAppConfigFile = createAndValidateOptionalProjectAppConfigurationFile(this.projectAppConfigurationFile);
    Map<String, File> configurationFileForServiceName = getAndValidateStringFilesMap(this.serviceConfigurationFile);
    List<WebEnvironment.WebScope> splittedWebAppScopes = extractWebScopes(webAppScopes);
    Map<WebEnvironment.WebScope, File> webAppConfigurationFilesForWebScopes = getAndValidateWebScopeFileMap(this.webAppConfigurationFiles);
    return new ModuleInstallationParameters(projectName, firstSpiritModule, configurationFileForServiceName, projectAppConfigFile, splittedWebAppScopes, webAppConfigurationFilesForWebScopes);
}

[Buggy Hunk]
throw new IllegalArgumentException("Could not open .fsm file");

[Patch]
throw new IllegalArgumentException("Could not open .fsm file: " + firstSpiritModule.getPath());

[Demonstration 2]

[Buggy Method]
public CallGraph readCallGraph(InputStream file) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(file));
    CallGraph ret = new CallGraph();
    while (true) {
        String line = in.readLine();
        if (line == null)
            break;
        if (line.equals(Util.ClassTag)) {
            String id = in.readLine();
            String pkg = in.readLine();
            String name = in.readLine();
            ProbeClass cls = ObjectManager.v().getClass(pkg, name);
            nodeToClass.put(id, cls);
        } else if (line.equals(Util.MethodTag)) {
            String id = in.readLine();
            String name = in.readLine();
            String signature = in.readLine();
            String cls = in.readLine();
            ProbeMethod m = ObjectManager.v().getMethod(nodeToClass.get(cls), name, signature);
            nodeToMethod.put(id, m);
        } else if (line.equals(Util.EntrypointTag)) {
            String id = in.readLine();
            ret.entryPoints().add(nodeToMethod.get(id));
        } else if (line.equals(Util.EdgeTag)) {
            String src = in.readLine();
            String dst = in.readLine();
            String weight = in.readLine();
            String context = in.readLine();
            ret.edges().add(new CallEdge(nodeToMethod.get(src), nodeToMethod.get(dst), Double.parseDouble(weight), context));
        } else {
            throw new RuntimeException("Unexpected line: " + line);
        }
    }
    in.close();
    return ret;
}

[Buggy Hunk]
BufferedReader in = new BufferedReader(new InputStreamReader(file));

[Patch]
BufferedReader in = new BufferedReader(new InputStreamReader(file, "UTF-8"));

[Demonstration 3]

[Buggy Method]
@Override
protected void onServiceConnected() {
    IntentFilter intentFilter = new IntentFilter();
    intentFilter.addAction(Intent.ACTION_SCREEN_ON);
    intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
    intentFilter.addAction(Intent.ACTION_SHUTDOWN);
    screenOnReceiver = new ScreenOnReceiver(this);
    registerReceiver(screenOnReceiver, intentFilter);
    PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
    PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
    queue = new InformationQueue(wakeLock, this);
    SharedprefsHelper sharedprefsHelper = new SharedprefsHelper(this);
    if (sharedprefsHelper.getDataCollectionFinishedMillis() == 0L) {
        Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(System.currentTimeMillis());
        if (BuildConfig.DEBUG)
            cal.add(Calendar.SECOND, 10);
        cal.add(Calendar.DAY_OF_YEAR, BuildConfig.INQUIRY_DUR);
        sharedprefsHelper.setDataCollectionFinishedMillis(cal.getTimeInMillis());
        //setup alarm
        startService(new Intent(this, DataCollectionAlarmIntent.class));
    }
    //service could be restarted while it is unknown whether the screen is on or off:
    isScreenOn = isScreenCurrentlyOn();
    super.onServiceConnected();
}

[Buggy Hunk]
queue = new InformationQueue(wakeLock, this);

[Patch]
queue = new InformationQueue(wakeLock, getApplicationContext());