[Demonstration 1]

[Buggy Method]
public static String writeStackTrace(Exception e) {
    String error = "";
    for (StackTraceElement elem : e.getStackTrace()) {
        error += elem.toString();
        error += "\n";
    }
    return error;
}

[Buggy Hunk]
String error = "";

[Patch]
String error = e.toString() + "\n";

[Demonstration 2]

[Buggy Method]
public static ArrayList<Object> getObjects(int userId) {
    String query = "SELECT * FROM object WHERE userId = ?";
    ArrayList<Object> result = new ArrayList<Object>();
    try {
        PreparedStatement ps = con.prepareStatement(query);
        ps.setString(1, "" + userId);
        ResultSet rs = ps.executeQuery();
        while (rs.next()) {
            Object temp = new Object(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getString(4));
            result.add(temp);
        }
    } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return result;
}

[Buggy Hunk]
Object temp = new Object(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getString(4));

[Patch]
object temp = new object(rs.getInt(1), rs.getInt(2), rs.getInt(3), rs.getString(4));

[Demonstration 3]

[Buggy Method]
public Cursor getEntry(String query) {
    SQLiteDatabase db = this.getWritableDatabase();
    Cursor res = db.rawQuery("select * from " + TABLE_ENTRY_NAME, null);
    return res;
}

[Buggy Hunk]
Cursor res = db.rawQuery("select * from " + TABLE_ENTRY_NAME, null);

[Patch]
Cursor res = db.rawQuery(query, null);