[Demonstration 1]

[Buggy Method]
private String describeAnswerLikes(Request req, Response res) {
    JsonResponse jsonResponse = new JsonResponse();
    int answerIdInt;
    String answerId = req.queryParams("answer_id");
    if (answerId == null)
        return jsonResponse.setStatus("ParameterError").toJson();
    try {
        answerIdInt = Integer.parseInt(answerId);
    } catch (Exception e) {
        return jsonResponse.setStatus("ParameterError").toJson();
    }
    List<Like> likes = likeService.describeAnswerLikes(answerIdInt);
    if (likes.isEmpty())
        return jsonResponse.setStatus("LikesNotFound").toJson();
    jsonResponse.setObject(likes);
    return jsonResponse.setStatus("Success").toJson();
}

[Buggy Hunk]
List<Like> likes = likeService.describeAnswerLikes(answerIdInt);

[Patch]
List<Like> likes = likeService.getLikesByAnswer(answerIdInt);

[Demonstration 2]

[Buggy Method]
public static String normalizeOperatorToken(String token, int start, int end) {
    StringBuffer sb = new StringBuffer(token.length());
    for (int i = start; i < end; i++) {
        char ch = token.charAt(i);
        int p = "＋－＊／％＠＝＜＞！＆｜".indexOf(ch);
        if (0 <= p) {
            sb.append("+-*/%@=<>!&|".charAt(p));
            continue;
        }
        p = "×÷".indexOf(ch);
        if (0 <= p) {
            sb.append("*/".charAt(p));
            continue;
        }
        sb.append(ch);
    }
    return sb.toString();
}

[Buggy Hunk]
StringBuffer sb = new StringBuffer(token.length());

[Patch]
StringBuffer sb = new StringBuffer(end - start);

[Demonstration 3]

[Buggy Method]
public static double[][] transpose(double[][] a) {
    double[][] tmp = new double[a[0].length][a.length];
    for (int j = 0; j < a[0].length; j++) for (int i = 0; i < a.length; i++) tmp[j][i] = a[i][j];
    return tmp;
}

[Buggy Hunk]
double[][] tmp = new double[a[0].length][a.length];

[Patch]
final double[][] tmp = new double[a[0].length][a.length];