[Demonstration 1]

[Buggy Method]
private void printLines(String name, Collection<? extends BaseMetadata> list) {
    for (BaseMetadata metadata : list) {
        m_writer.println(getAllProperties(name, metadata));
    }
}

[Buggy Hunk]
m_writer.println(getAllProperties(name, metadata));

[Patch]
printLine(getAllProperties(name, metadata));

[Demonstration 2]

[Buggy Method]
public static void set(@NonNull final Thread thread) {
    String postMessage = String.format("threadid=%s&title=%s&content=%s&author=%s&topicid=%s", thread.getThreadId(), thread.getTitle(), thread.getRawContent(), thread.getCreatorID(), thread.getTopicId());
    if (thread.getAttachId() >= 0) {
        postMessage = String.format("%s&attachid=%s", postMessage, thread.getAttachId());
    }
    new AsyncHelper(thread.getServerIndex(), "editpost", postMessage) {

        @Override
        protected void onPostExecute(@Nullable JSONObject jsonObject) {
            Thread newThread = null;
            if (jsonObject != null) {
                newThread = thread;
                try {
                    newThread.setMtime(new Date(jsonObject.getString("mtime")));
                    LongSparseArray<Thread> threadList = threads.get(newThread.getServerIndex());
                    if (threadList == null) {
                        threadList = new LongSparseArray<>();
                        threadList.append(newThread.getThreadId(), newThread);
                        threads.append(newThread.getServerIndex(), threadList);
                    } else {
                        threadList.put(newThread.getThreadId(), newThread);
                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
            if (modifyListener != null) {
                modifyListener.onModify(newThread);
                modifyListener = null;
            }
        }
    }.execute();
}

[Buggy Hunk]
newThread.setMtime(new Date(jsonObject.getString("mtime")));

[Patch]
newThread.setMtime(GlobalFunctions.parseDate(jsonObject.getString("mtime")));

[Demonstration 3]

[Buggy Method]
public static void writeFile(String filepath, byte[] data) throws IOException {
    File file = ensureWritable(filepath);
    File writeFile = getBackupFile(file);
    try (FileOutputStream out = new FileOutputStream(writeFile)) {
        out.write(data);
    }
    file.delete();
    writeFile.renameTo(file);
    log.debug("written file: " + file.getAbsolutePath());
}

[Buggy Hunk]
File writeFile = getBackupFile(file);

[Patch]
File writeFile = getWriteFile(file);