[Demonstration 1]

[Buggy Method]
private void parseAttributes() {
    //get housing facets/attributes
    Elements attrs = doc.select("p.attrgroup");
    for (Element attr : attrs) {
        Elements desc = attr.children();
        for (Element innerAttr : desc) {
            String attrText = innerAttr.text();
            if (!attrText.isEmpty()) {
                //System.out.println(attrText);
                if (attrText.contains("BR")) {
                    String[] Br_Ba = attrText.replaceAll("(\\p{Alpha})", "").trim().split("/");
                    detailAttrs.put("bedroom_s", Integer.toString(parseInt(Br_Ba[0].trim())));
                    try {
                        if (!Br_Ba[1].isEmpty()) {
                            if (Br_Ba[1].contains("."))
                                detailAttrs.put("bathroom_s", Float.toString(parseFloat(Br_Ba[1].trim())));
                            else
                                detailAttrs.put("bathroom_s", Integer.toString(parseInt(Br_Ba[1].trim())));
                        } else
                            detailAttrs.put("bathroom_s", "Other");
                    } catch (ArrayIndexOutOfBoundsException a) {
                        detailAttrs.put("bathroom_s", "Other");
                    }
                } else if (attrText.matches("[0-9]+ft")) {
                    detailAttrs.put("sqft_s", new Integer(parseInt(attrText.split("(\\p{Alpha})")[0])).toString());
                } else if (attrText.contains("available")) {
                    detailAttrs.put("available_s", attrText);
                } else if (attrText.contains("furnished")) {
                    detailAttrs.put("furnished_s", "true");
                } else if (attrText.contains("smoking")) {
                    detailAttrs.put("smoking_s", "false");
                } else if (attrText.contains("wheelchair")) {
                    detailAttrs.put("wheelchair_s", "true");
                } else if (attrText.contains("cats")) {
                    detailAttrs.put("cats_s", "true");
                } else if (attrText.contains("dogs")) {
                    detailAttrs.put("dogs_s", "true");
                } else if (attrText.contains("laundry") || attrText.contains("w/d")) {
                    if (attrText.contains("No") || attrText.contains("hookups")) {
                        detailAttrs.put("laundry_s", "false");
                    } else {
                        detailAttrs.put("laundry_s", "true");
                    }
                } else if (attrText.contains("garage") || attrText.contains("carport") || attrText.contains("parking")) {
                    if (attrText.contains("No")) {
                        detailAttrs.put("parking_s", "false");
                    } else {
                        detailAttrs.put("parking_s", "true");
                    }
                } else {
                    // last option should be housing type, e.g., house, apartment, condo, etc.
                    detailAttrs.put("housetype_s", attrText);
                }
            }
        }
    }
}

[Buggy Hunk]
else if(attrText.matches("[0-9]+ft")){

[Patch]
else if(attrText.contains("ft") && !attrText.contains("loft")){

[Demonstration 2]

[Buggy Method]
@Bean
CorsConfigurationSource corsConfigurationSource() {
    CorsConfiguration configuration = new CorsConfiguration();
    configuration.setAllowedOrigins(Arrays.asList("http://localhost:4200"));
    configuration.setAllowedMethods(Arrays.asList("GET", "POST", "OPTIONS"));
    configuration.setAllowedHeaders(Arrays.asList("Access-Control-Allow-Headers", "Content-Type", "authorization"));
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    source.registerCorsConfiguration("/**", configuration);
    return source;
}

[Buggy Hunk]
configuration.setAllowedHeaders(Arrays.asList("Access-Control-Allow-Headers", "Content-Type","authorization"));

[Patch]
configuration.setAllowedHeaders(Arrays.asList("0","1", "Access-Control-Allow-Headers", "Access-Control-Allow-Origin","Content-Type", "Authorization", "X-Requested-With"));

[Demonstration 3]

[Buggy Method]
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
    String method = request.getMethod();
    String url = request.getServletPath();
    String auth = request.getHeader(BASIC_AUTH_HEADER_NAME);
    if (method == "OPTIONS") {
        filterChain.doFilter(request, response);
        return;
    }
    if (checkUrl(url, method)) {
        filterChain.doFilter(request, response);
        return;
    }
    if (auth == null) {
        HttpSession session = request.getSession(false);
        if (session == null) {
            response.sendError(HttpServletResponse.SC_FORBIDDEN, FULL_AUTHENTICATION_REQUIRED);
            return;
        }
        String tokenString = request.getHeader(RESPONSE_TOKEN_NAME);
        if (tokenString == null) {
            // Delete any tokens linked to the session - automatic log out
            CSRFCustomRepository.deleteToken(request);
            response.sendError(HttpServletResponse.SC_FORBIDDEN, FULL_AUTHENTICATION_REQUIRED);
            return;
        } else {
            CsrfToken storedToken = CSRFCustomRepository.obtainToken(request);
            if (storedToken != null && storedToken.getToken().equals(tokenString)) {
                filterChain.doFilter(request, response);
                return;
            } else {
                CSRFCustomRepository.deleteToken(request);
                response.sendError(HttpServletResponse.SC_FORBIDDEN, FULL_AUTHENTICATION_REQUIRED);
                return;
            }
        }
    } else {
        filterChain.doFilter(request, response);
        return;
    }
}

[Buggy Hunk]
if(method == "OPTIONS") {

[Patch]
if(method.equals("OPTIONS")) {