[Demonstration 1]

[Buggy Method]
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    allJobs = null;
    final View rootView = inflater.inflate(R.layout.fragment_scratch_converter_sliding_up_panel, container, false);
    convertIconImageView = (ImageView) rootView.findViewById(R.id.scratch_convert_icon);
    convertPanelHeadlineView = (TextView) rootView.findViewById(R.id.scratch_convert_headline);
    convertPanelStatusView = (TextView) rootView.findViewById(R.id.scratch_convert_status_text);
    convertProgressLayout = (RelativeLayout) rootView.findViewById(R.id.scratch_convert_progress_layout);
    convertProgressBar = (ProgressBar) rootView.findViewById(R.id.scratch_convert_progress_bar);
    convertStatusProgressTextView = (TextView) rootView.findViewById(R.id.scratch_convert_status_progress_text);
    upDownArrowImageView = (ImageView) rootView.findViewById(R.id.scratch_up_down_image_button);
    conversionList = (RelativeLayout) rootView.findViewById(R.id.scratch_conversion_list);
    conversionListView = (ListView) rootView.findViewById(R.id.scratch_conversion_list_view);
    convertedProgramsList = (RelativeLayout) rootView.findViewById(R.id.scratch_converted_programs_list);
    convertedProgramsListView = (ListView) rootView.findViewById(R.id.scratch_converted_programs_list_view);
    convertPanelStatusView.setVisibility(View.VISIBLE);
    convertProgressLayout.setVisibility(View.GONE);
    conversionList.setVisibility(View.GONE);
    convertedProgramsList.setVisibility(View.GONE);
    return rootView;
}

[Buggy Hunk]
allJobs = null;

[Patch]
allJobs = new ArrayList<>();

[Demonstration 2]

[Buggy Method]
private long parseDateTime(String value, DateTimeZone timeZone, boolean roundUpIfNoTime) {
    DateTimeFormatter parser = dateTimeFormatter.parser();
    if (timeZone != null) {
        String format = dateTimeFormatter.format();
        // Non UTC time zones are not compatible with epoch formats
        if (timeZone != DateTimeZone.UTC && format.equals("epoch_second") || format.equals("epoch_millis")) {
            throw new ElasticsearchParseException("Format [{}] only supports UTC time zones", format);
        }
        parser = parser.withZone(timeZone);
    }
    try {
        MutableDateTime date;
        // We use 01/01/1970 as a base date so that things keep working with date
        // fields that are filled with times without dates
        if (roundUpIfNoTime) {
            date = new MutableDateTime(1970, 1, 1, 23, 59, 59, 999, DateTimeZone.UTC);
        } else {
            date = new MutableDateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC);
        }
        final int end = parser.parseInto(date, value, 0);
        if (end < 0) {
            int position = ~end;
            throw new IllegalArgumentException("Parse failure at index [" + position + "] of [" + value + "]");
        } else if (end != value.length()) {
            throw new IllegalArgumentException("Unrecognized chars at the end of [" + value + "]: [" + value.substring(end) + "]");
        }
        return date.getMillis();
    } catch (IllegalArgumentException e) {
        throw new ElasticsearchParseException("failed to parse date field [{}] with format [{}]", e, value, dateTimeFormatter.format());
    }
}

[Buggy Hunk]
if (timeZone != DateTimeZone.UTC && format.equals("epoch_second") || format.equals("epoch_millis")) {

[Patch]
if (timeZone != DateTimeZone.UTC && (format.equals("epoch_second") || format.equals("epoch_millis"))) {

[Demonstration 3]

[Buggy Method]
private static ArrayList<String> toPostFix(ArrayList<String> expression) {
    Stack<Character> operatorStack = new Stack<Character>();
    ArrayList<String> postFixExpression = new ArrayList<String>();
    for (String s : expression) {
        if (s.matches(OPERATOR_REGEX)) {
            if (operatorStack.empty())
                operatorStack.push(s.charAt(0));
            else {
                char operatorInStack = operatorStack.peek();
                char operatorToPush = s.charAt(0);
                while (OPERATOR_PRECEDENCE.indexOf(new Character(operatorInStack)) > OPERATOR_PRECEDENCE.indexOf(new Character(operatorToPush))) {
                    operatorStack.pop();
                    postFixExpression.add("" + operatorInStack);
                    operatorInStack = operatorStack.peek();
                }
                operatorStack.push(operatorToPush);
            }
        } else {
            postFixExpression.add(s);
        }
    }
    while (!operatorStack.empty()) {
        postFixExpression.add("" + operatorStack.pop());
    }
    return postFixExpression;
}

[Buggy Hunk]
while (OPERATOR_PRECEDENCE.indexOf(new Character(operatorInStack)) > OPERATOR_PRECEDENCE

[Patch]
while (OPERATOR_PRECEDENCE.indexOf(new Character(operatorInStack)) >= OPERATOR_PRECEDENCE