<commit_before>import Misc.Constants;
import jdk.nashorn.api.scripting.JSObject;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

/**
 * Created by jman0_000 on 12/25/2015.
 */
public class sentOrRcvdConn {
	public static void getSentOrRcvdConns(HttpServletRequest req, HttpServletResponse resp, Connection connection, String mode, String id)
			throws IOException {
		try {
			String select_sql;
			if (mode.equals("sent")) {
				select_sql = "Select c.target_id, c.status, p.* from connections c " +
						"join profile p on p.user_id = c.target_id " +
						"where c.requester_id = ?;";
			}
			else {
				select_sql = "Select c.requester_id, c.status, p.* from connections c " +
						"join profile p on p.user_id = c.target_id " +
						"where c.target_id = ?;";
			}

			PreparedStatement stmt = connection.prepareStatement(select_sql);
			try {
				stmt.setLong(1, Long.parseLong(id));
			}
			catch (NumberFormatException e) {
				resp.setStatus(Constants.BAD_REQUEST);
				return;<commit_msg>Typo in a SQL stmt in sentOrRcvdConn<commit_after>import Misc.Constants;
import jdk.nashorn.api.scripting.JSObject;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

/**
 * Created by jman0_000 on 12/25/2015.
 */
public class sentOrRcvdConn {
	public static void getSentOrRcvdConns(HttpServletRequest req, HttpServletResponse resp, Connection connection, String mode, String id)
			throws IOException {
		try {
			String select_sql;
			if (mode.equals("sent")) {
				select_sql = "Select c.target_id, c.status, p.* from connections c " +
						"join profile p on p.user_id = c.target_id " +
						"where c.requester_id = ?;";
			}
			else {
				select_sql = "Select c.requester_id, c.status, p.* from connections c " +
						"join profile p on p.user_id = c.requester_id " +
						"where c.target_id = ?;";
			}

			PreparedStatement stmt = connection.prepareStatement(select_sql);
			try {
				stmt.setLong(1, Long.parseLong(id));
			}
			catch (NumberFormatException e) {
				resp.setStatus(Constants.BAD_REQUEST);
				return;
{'fraction_non_alphanumeric': 0.10968229954614221, 'fraction_numerical': 0.009833585476550681, 'mean_word_length': 4.0, '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': '3932066', 'n_tokens_mistral': 981, 'n_tokens_neox': 855, 'n_words': 201}