[Demonstration 1]

[Buggy Method]
public static boolean isStudy(Context c) {
    boolean participant = false;
    Cursor study = c.getContentResolver().query(Aware_Provider.Aware_Studies.CONTENT_URI, null, Aware_Provider.Aware_Studies.STUDY_URL + " LIKE '" + Aware.getSetting(c, Aware_Preferences.WEBSERVICE_SERVER) + "' AND " + Aware_Provider.Aware_Studies.STUDY_JOINED + ">0" + " AND " + Aware_Provider.Aware_Studies.STUDY_EXIT + "=0", null, null);
    if (study != null && study.moveToFirst())
        participant = true;
    if (study != null && !study.isClosed())
        study.close();
    return participant;
}

[Buggy Hunk]
Aware_Provider.Aware_Studies.STUDY_URL + " LIKE '" + Aware.getSetting(c, Aware_Preferences.WEBSERVICE_SERVER) +

[Patch]
Aware_Provider.Aware_Studies.STUDY_URL + " LIKE '" + Aware.getSetting(c, Aware_Preferences.WEBSERVICE_SERVER) + "%" +

[Demonstration 2]

[Buggy Method]
@Override
protected String doInBackground(Boolean... params) {
    try {
        List<String> filePathsToZip = new ArrayList<String>();
        JSONObject pathInfo = getLogFilePaths(true);
        Iterator<String> iter = pathInfo.keys();
        while (iter.hasNext()) {
            String key = iter.next();
            try {
                String filePath = pathInfo.getString(key);
                filePathsToZip.add(filePath);
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
        if (params[0]) {
            JSONObject archivedPathInfo = getArchivedLogFilePaths();
            Iterator<String> iter2 = archivedPathInfo.keys();
            while (iter2.hasNext()) {
                String key = iter2.next();
                try {
                    List<String> archivedLogFilePaths = (List) archivedPathInfo.get(key);
                    if (archivedLogFilePaths != null) {
                        filePathsToZip.addAll(archivedLogFilePaths);
                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
        }
        File tmpToZipFolder = new File(cordova.getActivity().getFilesDir(), "tmpToZipFolder");
        tmpToZipFolder.mkdir();
        File zipFile = new File(logFileStorageLocation, LOGS_ZIP_FOLDER_NAME);
        if (zipFile.exists())
            zipFile.delete();
        for (String filePath : filePathsToZip) {
            String fileName = filePath.substring(filePath.lastIndexOf("/") + 1);
            fileName = fileName.replace("%20", " ");
            File inputFile = new File(filePath);
            File outputFile = new File(tmpToZipFolder, fileName);
            copy(inputFile, outputFile);
        }
        ZipUtility.zipDirectory(tmpToZipFolder, zipFile);
        deleteDirectory(tmpToZipFolder);
        return zipFile.getAbsolutePath();
    } catch (Exception e) {
        return null;
    }
}

[Buggy Hunk]
JSONObject pathInfo = getLogFilePaths(true);

[Patch]
JSONObject pathInfo = getLogFilePaths();

[Demonstration 3]

[Buggy Method]
@Override
public void delete(String id, long time) {
    try {
        JSONObject json = new JSONObject();
        json.put("id", id);
        json.put("time", time);
        socket.send(json.toString());
        logger.info("delete object {}", id);
    } catch (Exception e) {
        logger.error("delete failed: {}", e.getMessage());
        e.printStackTrace();
    }
}

[Buggy Hunk]
socket.send(json.toString());

[Patch]
queue.put(json.toString());