[Demonstration 1]

[Buggy Method]
public static PyException OSError(Constant errno) {
    int value = errno.intValue();
    PyObject args = new PyTuple(Py.newInteger(value), PosixModule.strerror(value));
    return new PyException(Py.OSError, args);
}

[Buggy Hunk]
PyObject args = new PyTuple(Py.newInteger(value), PosixModule.strerror(value));

[Patch]
PyObject args = new PyTuple(Py.newInteger(value), Py.newUnicode(Errno.valueOf(value).description()));

[Demonstration 2]

[Buggy Method]
static private boolean jj_3R_50() {
    if (jj_scan_token(GREATERTHAN))
        return true;
    if (jj_3R_32())
        return true;
    return false;
}

[Buggy Hunk]
static private boolean jj_3R_50() {

[Patch]
private boolean jj_3R_50() {

[Demonstration 3]

[Buggy Method]
public String perform(HttpServletRequest request) {
    Util.i();
    List<String> errors = new ArrayList<String>();
    request.setAttribute("errors", errors);
    try {
        int id = getId(request);
        Photo photo = model.getPhotoDAO().read(id);
        if (photo == null) {
            errors.add("invalid id");
            return LIKE_FAILED_PAGE;
        }
        photo.setLikes(photo.getLikes() + 1);
        model.getPhotoDAO().update(photo);
        model.likeHistoryDAO.inc(photo.getUserId());
        return ViewPhotoAction.NAME;
    } catch (RollbackException e) {
        Util.e(e);
        errors.add(e.getMessage());
        return LIKE_FAILED_PAGE;
    } finally {
        if (Transaction.isActive()) {
            Transaction.rollback();
        }
    }
}

[Buggy Hunk]
return ViewPhotoAction.NAME;

[Patch]
return Util.getString(ViewPhotoAction.NAME, "?id=", photo.getId());