[Demonstration 1]

[Buggy Method]
public static boolean isUserExists(String userName) {
    boolean isExists = false;
    try {
        EntityDAO dao = new EntityDAOImpl();
        User user = dao.getUserByName(userName);
        if (user != null) {
            isExists = true;
        }
    } catch (Exception ex) {
        System.err.println("Exception in UserDAOUtil: " + ex);
        throw ex;
    }
    return isExists;
}

[Buggy Hunk]
public static boolean isUserExists(String userName) {

[Patch]
public static boolean isUserExists(String userName) throws Exception {

[Demonstration 2]

[Buggy Method]
public static boolean loginUser(String userName, String password, Text attemptsLeft) {
    checkTries(attemptsLeft, userName);
    try {
        return (checkFile() && checkUserName(userName) && checkPassWord(password, userName) && (counter < 3) && check);
    } catch (IOException e) {
        System.out.println("Error while logging in user");
        return (false);
    }
}

[Buggy Hunk]
return (checkFile() && checkUserName(userName) && checkPassWord(password, userName) && (counter < 3) && check);

[Patch]
return (checkFile() && checkUserName(userName) && checkPassWord(password, userName) && check);

[Demonstration 3]

[Buggy Method]
public static void createGUI() {
    String studentId = LoginGUI.getLoginId().getText();
    MarksDAO marksDAO = new MarksDAO();
    studentId = LoginGUI.getLoginId().getText();
    ArrayList<String> studentScoreList = marksDAO.getStudentModuleList(studentId);
    new StudentCheckGradeInfoGUI(studentScoreList);
}

[Buggy Hunk]
new StudentCheckGradeInfoGUI(studentScoreList);

[Patch]
studentCheckGrade = new StudentCheckGradeInfoGUI(studentScoreList);