<commit_before>package com.screaminggreen.sculptor;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class LogoutServlet extends HttpServlet {

	public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		
		//Clear the session map
		req.getSession().invalidate();
		
		//Return to home page now
		resp.sendRedirect("/index.html");
		return;
	}
	
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		
		//Clear the session map
		req.getSession().invalidate();
		
		//Return to home page now
		resp.sendRedirect("/index.html");
		return;
	}
}
<commit_msg>Proper way to invalidate session<commit_after>package com.screaminggreen.sculptor;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class LogoutServlet extends HttpServlet {

	public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		
		//Clear the session map
		HttpSession session = req.getSession(false);
		
		if(session != null) {
			session.invalidate();
		}
		
		//Return to home page now
		resp.sendRedirect("/index.html");
		return;
	}
	
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		
		//Clear the session map
		HttpSession session = req.getSession(false);
		
		if(session != null) {
			session.invalidate();
		}
		
		//Return to home page now
		resp.sendRedirect("/index.html");
		return;
	}
}

{'fraction_non_alphanumeric': 0.09822485207100591, 'fraction_numerical': 0.0, 'mean_word_length': 4.35126582278481, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3024483', 'n_tokens_mistral': 526, 'n_tokens_neox': 469, 'n_words': 126}