<commit_before>package swsec;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class Login extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private ServletContext servletcontext;

	public Login() {
		super();
	}

	public void init(ServletConfig config) throws ServletException {
		servletcontext = config.getServletContext();
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		HttpSession session = request.getSession(true);
		String username = request.getParameter("username");
		String password = request.getParameter("password");
		try {
			Class.forName("org.sqlite.JDBC");
			Connection conexion = DriverManager.getConnection(Config.getSqliteUrl(servletcontext));
			Statement statement = conexion.createStatement();
			String query = "select * from usuarios where username='" + username + "' and password = '" + password + "'";
			ResultSet resultado = statement.executeQuery(query);
			int numFilas = 0;
			while (resultado.next())
				numFilas++;
			statement.close();
			conexion.close();
			if (numFilas > 0) {
				session.setAttribute("username", username);
				response.sendRedirect(request.getParameter("landingPage"));
			} else {
				response.sendRedirect("login.jsp?notFoundError=1");
			}
		} catch (Exception e) {
			throw new ServletException(e);
		}
	}

}<commit_msg>Default Landing page on login<commit_after>package swsec;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class Login extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private ServletContext servletcontext;

	public Login() {
		super();
	}

	public void init(ServletConfig config) throws ServletException {
		servletcontext = config.getServletContext();
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		HttpSession session = request.getSession(true);
		String username = request.getParameter("username");
		String password = request.getParameter("password");
		try {
			Class.forName("org.sqlite.JDBC");
			Connection conexion = DriverManager.getConnection(Config.getSqliteUrl(servletcontext));
			Statement statement = conexion.createStatement();
			String query = "select * from usuarios where username='" + username + "' and password = '" + password + "'";
			ResultSet resultado = statement.executeQuery(query);
			int numFilas = 0;
			while (resultado.next())
				numFilas++;
			statement.close();
			conexion.close();
			if (numFilas > 0) {
				session.setAttribute("username", username);
				String landingPage = request.getParameter("landingPage");
				response.sendRedirect(landingPage != null ? landingPage : "saludos.jsp");
			} else {
				response.sendRedirect("login.jsp?notFoundError=1");
			}
		} catch (Exception e) {
			throw new ServletException(e);
		}
	}

}
{'fraction_non_alphanumeric': 0.10930616740088106, 'fraction_numerical': 0.0022026431718061676, 'mean_word_length': 5.2637931034482754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7196664', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1004, 'n_words': 236}