[Demonstration 1]

[Buggy Method]
@Override
public String toString() {
    try {
        String text = this.text;
        if (text == null) {
            text = decodeContent();
        }
        if (text != null) {
            text = MarshallingSupport.truncate64(text);
            HashMap<String, Object> overrideFields = new HashMap<String, Object>();
            overrideFields.put("text", text);
            return super.toString(overrideFields);
        }
    } catch (JMSException e) {
    }
    return super.toString();
}

[Buggy Hunk]
text = decodeContent();

[Patch]
text = decodeContent(getContent());

[Demonstration 2]

[Buggy Method]
private void changeItem(final boolean adding, final Filter original) {
    String message = this.getString(R.string.add_filter);
    ViewMode viewMode = ViewMode.Defaults;
    if (!adding) {
        viewMode = ViewMode.Populate;
        message = this.getString(R.string.update_filter);
    }
    final View view = this.getItemView(viewMode, original);
    this.okCancelDialog(message, null, view, false, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int whichButton) {
            String text = ((EditText) view.findViewById(R.id.editText)).getText().toString();
            if (text != null && !text.isEmpty()) {
                if (!adding) {
                    MainActivity.this.arrayAdapter.remove(original);
                }
                boolean regex = getCheck(view, R.id.regexCheck);
                boolean ignore = getCheck(view, R.id.ignoreCheck);
                boolean disable = getCheck(view, R.id.disableCheck);
                Filter outputFilter = new Filter(text, ignore, regex, disable);
                MainActivity.this.arrayAdapter.add(outputFilter);
                MainActivity.this.doNotifyChange();
            }
        }
    });
}

[Buggy Hunk]
if (text != null && !text.isEmpty()) {

[Patch]
if (!text.isEmpty()) {

[Demonstration 3]

[Buggy Method]
@ExceptionHandler(TranslatableException.class)
public void handleExceptions(TranslatableException e, Locale locale, HttpServletResponse response) throws IOException {
    logger.info(e.getMessage());
    final HttpStatus status = getHttpStatus(e);
    response.setStatus(status.value());
    if (e.getMessage() != null) {
        final String jsonErrorMessage = format("{\"error\":%s}", extractMessage(e, locale));
        response.getWriter().write(jsonErrorMessage);
    }
}

[Buggy Hunk]
final String jsonErrorMessage = format("{\"error\":%s}", extractMessage(e, locale));

[Patch]
final String jsonErrorMessage = format("{\"error\":\"%s\"}", extractMessage(e, locale));