[Demonstration 1]

[Buggy Method]
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
    httpSecurity.// we don't need CSRF because our token is invulnerable
    csrf().disable().exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and().// don't create session
    sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().authorizeRequests().antMatchers(HttpMethod.OPTIONS, "/**").permitAll().antMatchers("/auth/**", "/h2-console/**", "/refresh", "/product/images/**").permitAll().anyRequest().authenticated();
    // Custom JWT based security filter
    httpSecurity.addFilterBefore(authenticationTokenFilterBean(), UsernamePasswordAuthenticationFilter.class);
    // disable page caching
    httpSecurity.headers().cacheControl();
}

[Buggy Hunk]
.antMatchers("/auth/**","/h2-console/**","/refresh","/product/images/**").permitAll()

[Patch]
.antMatchers("/auth/**","/h2-console/**","/refresh","/product/images/**","/product").permitAll()

[Demonstration 2]

[Buggy Method]
public static void main(String[] args) {
    Date currentDate = Calendar.getInstance().getTime();
    System.out.println(currentDate);
    try {
        FirebaseOptions options = new FirebaseOptions.Builder().setServiceAccount(new FileInputStream("/home/khanh/Butterfly-40ec2c75b546.json")).setDatabaseUrl("butterfly-145620.firebaseio.com/").build();
        FirebaseApp.initializeApp(options);
        ServerSocket serverSocket = new ServerSocket(3300);
        JSONParser parser = new JSONParser();
        String appKey, PASS, Authorization;
        FileInputStream fileIn = new FileInputStream("/home/khanh/keys.txt");
        InputStreamReader isr = new InputStreamReader(fileIn, Charset.forName("UTF-8"));
        BufferedReader br = new BufferedReader(isr);
        appKey = br.readLine();
        PASS = br.readLine();
        Authorization = br.readLine();
        br.close();
        isr.close();
        new Thread(new eventCheck(PASS, Authorization)).start();
        new Thread(new hangoutCheck(PASS)).start();
        while (true) {
            System.out.println("Waiting on port " + serverSocket.getLocalPort() + "...");
            try {
                Socket server = serverSocket.accept();
                System.out.println("Just connected to " + server.getRemoteSocketAddress());
                DataInputStream in = new DataInputStream(server.getInputStream());
                DataOutputStream out = new DataOutputStream(server.getOutputStream());
                sleep(100);
                if (in.available() > 0) {
                    Object parsed = parser.parse(in.readUTF());
                    JSONObject obj = (JSONObject) parsed;
                    System.out.println("TIMESTAMP " + currentDate + " " + obj.get("function"));
                    new serverStart(obj, out, appKey, PASS, Authorization).run();
                }
            } catch (SocketTimeoutException s) {
                System.out.println("Socket timed out!");
            } catch (ParseException | InterruptedException e) {
                e.printStackTrace();
            }
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
}

[Buggy Hunk]
new serverStart(obj, out, appKey, PASS, Authorization).run();

[Patch]
new Thread(new serverStart(obj, out, appKey, PASS, Authorization)).start();

[Demonstration 3]

[Buggy Method]
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    // How each item in the array should be displayed in the view
    ViewHolder viewHolder;
    // Get the schdulable item
    Schedulable schedulable = getItem(position);
    if (convertView == null) {
        // Create new convert view
        convertView = LayoutInflater.from(getContext()).inflate(R.layout.list_schedule_row, parent, false);
        // Make new view holder
        viewHolder = new ViewHolder();
        // Set views for view holder
        viewHolder.task_layout = (RelativeLayout) convertView.findViewById(R.id.list_item_schedule_layout_task);
        viewHolder.task_name = (TextView) convertView.findViewById(R.id.list_item_schedule_name);
        viewHolder.task_description = (TextView) convertView.findViewById(R.id.list_item_schedule_description);
        viewHolder.task_subject = (TextView) convertView.findViewById(R.id.list_item_schedule_subject);
        viewHolder.task_start_time = (TextView) convertView.findViewById(R.id.list_item_schedule_start_time);
        viewHolder.voidblock_layout = (RelativeLayout) convertView.findViewById(R.id.list_item_schedule_layout_voidblock);
        viewHolder.voidblock_time = (TextView) convertView.findViewById(R.id.list_item_schedule_voidblock_time);
        // Set viewHolder to convertView
        convertView.setTag(viewHolder);
    } else {
        // Get viewHolder from convertView
        viewHolder = (ScheduleArrayAdapter.ViewHolder) convertView.getTag();
    }
    if (schedulable instanceof Task) {
        // If it is a task
        Calendar cal = Calendar.getInstance();
        Task task = (Task) schedulable;
        viewHolder.task_name.setText(task.getName());
        viewHolder.task_description.setText(task.getDescription());
        viewHolder.task_subject.setText(task.getSubject());
        // Show date only if it is not today
        String task_start_time = task.getScheduledStart().toFormattedString();
        int current_day = cal.get(Calendar.DAY_OF_MONTH);
        if (task.getScheduledStart().getDay() == current_day) {
            task_start_time = task_start_time.substring(0, 5) + task_start_time.substring(8, 14);
        }
        viewHolder.task_start_time.setText(task_start_time);
        viewHolder.task_layout.setVisibility(View.VISIBLE);
    } else {
        // If it is a voidblock
        Voidblock voidblock = (Voidblock) schedulable;
        viewHolder.voidblock_time.setText(voidblock.getScheduledStart().toFormattedString() + " - " + voidblock.getScheduledStop().toFormattedString());
        viewHolder.voidblock_layout.setVisibility(View.VISIBLE);
    }
    return convertView;
}

[Buggy Hunk]
task_start_time = task_start_time.substring(0, 5) + task_start_time.substring(8, 14);

[Patch]
task_start_time = task_start_time.substring(9, 14);