[Demonstration 1]

[Buggy Method]
public Map<String, String> getPrefixMappings() throws IOException {
    URL prefixMappingsURL = new URL(zoomaServicesBase + "prefixMappings");
    ObjectMapper mapper = new ObjectMapper();
    Map<String, String> results = mapper.readValue(prefixMappingsURL, new TypeReference<Map<String, String>>() {
    });
    getLog().trace(results.toString());
    return results;
}

[Buggy Hunk]
getLog().trace(results.toString());

[Patch]
log.trace(results.toString());

[Demonstration 2]

[Buggy Method]
public Matcher<View> atPositionOnView(final int position, final int targetViewId) {
    return new TypeSafeMatcher<View>() {

        Resources resources = null;

        View childView;

        public void describeTo(Description description) {
            String idDescription = Integer.toString(recyclerViewId);
            if (this.resources != null) {
                try {
                    idDescription = this.resources.getResourceName(recyclerViewId);
                } catch (Resources.NotFoundException var4) {
                    idDescription = String.format("%s (resource name not found)", new Object[] { Integer.valueOf(recyclerViewId) });
                }
            }
            description.appendText("with id: " + idDescription);
        }

        public boolean matchesSafely(View view) {
            this.resources = view.getResources();
            if (childView == null) {
                RecyclerView recyclerView = (RecyclerView) view.getRootView().findViewById(recyclerViewId);
                if (recyclerView != null && recyclerView.getId() == recyclerViewId) {
                    childView = recyclerView.getChildAt(position);
                } else {
                    return false;
                }
            }
            if (targetViewId == -1) {
                return view == childView;
            } else {
                View targetView = childView.findViewById(targetViewId);
                return view == targetView;
            }
        }
    };
}

[Buggy Hunk]
childView = recyclerView.getChildAt(position);

[Patch]
childView = recyclerView.findViewHolderForAdapterPosition(position).itemView;

[Demonstration 3]

[Buggy Method]
private void stopWriter() {
    Logger.getLogger(this.getClass().getName()).info("Stopping writer");
    //stop dummy threads if needed
    if (n_user > 1) {
        for (int i = 0; i < n_user - 1; i++) {
            dummies[i].cancel();
        }
        if (n_user > threshold) {
            for (int i = 0; i < n_user - threshold; i++) {
                remoteDummies[i].cancel();
            }
        }
    }
    //after reader finish, stop writer
    writer.cancel();
}

[Buggy Hunk]
for (int i = 0; i < n_user - 1; i++) {

[Patch]
for (int i = 0; i < n_LocalThread - 1; i++) {