Buggy code:
public class Handler extends HttpServlet { static Preference pref = new Preference ( 0 , Season . NONE ) ; private static final long serialVersionUID = 1L ; public Handler ( ) { } protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { System . out . println ( "INSIDE<seq2seq4repair_space>DO<seq2seq4repair_space>GET" ) ; if ( request . getParameter ( "action" ) . equals ( "authenticator" ) ) { String username = request . getParameter ( "username" ) ; String password = request . getParameter ( "password" ) ; response . setContentType ( "text//html" ) ; PrintWriter out = response . getWriter ( ) ; Authenticator authen = new Authenticator ( ) ; boolean log = authen . login ( username , password ) ; out . print ( log ) ; out . close ( ) ; } if ( request . getParameter ( "action" ) . equals ( "preference" ) ) { response . setContentType ( "text//html" ) ; PrintWriter out = response . getWriter ( ) ; if ( request . getParameter ( "option" ) . equals ( "add" ) ) { boolean addr = false ; String startTime = request . getParameter ( "start_time" ) ; String endTime = request . getParameter ( "end_time" ) ; String day = request . getParameter ( "day" ) ; System . out . println ( ( "starttime:<seq2seq4repair_space>" + startTime ) ) ; System . out . println ( ( "endtime:<seq2seq4repair_space>" + endTime ) ) ; System . out . println ( ( "day:<seq2seq4repair_space>" + day ) ) ; addr = Handler . pref . addBreak ( startTime , endTime , Constants . ConvertStringToDay ( day ) ) ; out . print ( addr ) ; } else if ( request . getParameter ( "option" ) . equals ( "remove" ) ) { boolean remover = false ; int index = Integer . parseInt ( request . getParameter ( "index" ) ) ; System . out . println ( ( "breakindex:<seq2seq4repair_space>" + index ) ) ; remover = Handler . pref . removeBreak ( index ) ; out . print ( remover ) ; } else if ( request . getParameter ( "option" ) . equals ( "setMaxCourses" ) ) { int maxCourses = Integer . parseInt ( request . getParameter ( "maxCoursesNum" ) ) ; Handler . pref . setMaxCourseNum ( maxCourses ) ; } else if ( request . getParameter ( "option" ) . equals ( "setSemester" ) ) { String semester = request . getParameter ( "newSemester" ) ; Handler . pref . setSeason ( Constants . ConvertStringToSeason ( semester ) ) ; } out . close ( ) ; } if ( request . getParameter ( "action" ) . equals ( "view_schedule" ) ) { System . out . println ( "in<seq2seq4repair_space>view" ) ; StudentSchedule schedule = StudentSchedule . getFakeSchedule ( ) ; response . setContentType ( "text//html" ) ; PrintWriter out = response . getWriter ( ) ; out . println ( schedule . printSchedule ( ) ) ; out . close ( ) ; } if ( request . getParameter ( "action" ) . equals ( "gen_schedule" ) ) { System . out . println ( "in<seq2seq4repair_space>gen" ) ; String studentId = request . getParameter ( "username" ) ; System . out . println ( ( "in<seq2seq4repair_space>gen:<seq2seq4repair_space>" + studentId ) ) ; ScheduleFactory factory = new ScheduleFactory ( ) ; System . out . println ( ( "pref<seq2seq4repair_space>" + ( Handler . pref . getSeason ( ) . toString ( ) ) ) ) ; <START_BUG> StudentSchedule schedule = factory . makeStudentSchedule ( studentId , Handler . pref ) ; <END_BUG> response . setContentType ( "text//html" ) ; PrintWriter out = response . getWriter ( ) ; out . println ( schedule . printSchedule ( ) ) ; out . close ( ) ; } } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { } }

Fix:
StudentSchedule schedule = factory . makeStudentSchedule ( studentId , Handler . pref , 0 , 0 ) ;