[Demonstration 1]

[Buggy Method]
@Override
protected void populateView(View view, final MessagesModel messageObj, final int i) {
    final TextView friendIdText = (TextView) view.findViewById(R.id.messageSender);
    TextView messageIdText = (TextView) view.findViewById(R.id.message);
    if (messageObj.getFriend() != null) {
        String friendName = messageObj.getFriend().getDisplayName();
        friendIdText.setText("From: " + friendName);
        String message = messageObj.getMessage();
        messageIdText.setText("Message: " + message);
        Log.v(LOG, "This is the sender's name: " + friendName + " message: " + message);
    }
}

[Buggy Hunk]
String friendName = messageObj.getFriend().getDisplayName();

[Patch]
String friendName = messageObj.getSenderName();

[Demonstration 2]

[Buggy Method]
public static boolean map(Values v) throws Exception {
    boolean rv = false;
    if (v == null)
        return rv;
    List<String> svs = v.getStringValues();
    if (svs.get(0).endsWith(">")) {
        int l = svs.size();
        List<String> refs = new ArrayList<String>(l);
        for (int i = 0; i < l; i++) {
            String sv = svs.get(i);
            int pos = sv.lastIndexOf(" <");
            if (pos == -1)
                throw new Exception("error mapping value '" + sv + "': either all or no values must be mapped in the file");
            String ref = sv.substring(pos + 2, sv.length() - 1);
            sv = sv.substring(0, pos);
            svs.set(i, sv);
            refs.add(ref);
        }
        if (svs.get(0).indexOf(":") > -1) {
            v.setOtermRefs(refs);
            v.setScalarType("oterm_ref");
        } else {
            v.setObjectRefs(refs);
            v.setScalarType("object_ref");
        }
        rv = true;
    }
    return rv;
}

[Buggy Hunk]
if (svs.get(0).indexOf(":")>-1) {

[Patch]
if (refs.get(0).indexOf(":")>-1) {

[Demonstration 3]

[Buggy Method]
public void loadMap(final String name) {
    String errorString = new DataManager(this.getApplicationContext()).loadMapName(name);
    if (errorString != null) {
        if (this.getApplicationContext() != null) {
            Toast toast = Toast.makeText(this.getApplicationContext(), "Could not load file.  Reason: " + errorString, Toast.LENGTH_LONG);
            toast.show();
        }
        this.setFilenamePreference(null);
        MapData.clear();
        // Open map error reporting dialog.
        reportBadMap(name, errorString);
    }
    mData = MapData.getInstance();
    if (mCombatView != null) {
        this.mCombatView.setData(mData);
    }
    if (mTagNavigator != null) {
        this.mTagNavigator.setTagPath(mData.getLastTag());
    }
}

[Buggy Hunk]
if (errorString != null) {

[Patch]
if (errorString != null || errorString.isEmpty()) {