<commit_before>package database_comm;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;

import retail.Item;

public class ItemDatabase
{

	/**Returns an item with the given barcode from the database. null if not found
	 * @throws SQLException */
	public static Item getItemFromBarcode(String barcode) throws SQLException
	{
		//Create query to find item with matching barcode
		DatabaseConnection connection = new DatabaseConnection();
		String query = "SELECT * FROM ITEMS WHERE BARCODE = '" + barcode + "'";

		//Set up our return item with null by default
		Item returnItem = null;

		try
		{
			//Execute our query
			ResultSet rs = connection.executeQuery(query);
			
			//Check if our query got any results
			if (rs.next())
			{
				//If so, create item instance from result data
				returnItem = new Item(barcode);
				returnItem.setDescription(rs.getString("DESCR"));
				returnItem.setPrice((int)(rs.getFloat("PRICE") * 100));<commit_msg>Change price casting in database to double<commit_after>package database_comm;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;

import retail.Item;

public class ItemDatabase
{

	/**Returns an item with the given barcode from the database. null if not found
	 * @throws SQLException */
	public static Item getItemFromBarcode(String barcode) throws SQLException
	{
		//Create query to find item with matching barcode
		DatabaseConnection connection = new DatabaseConnection();
		String query = "SELECT * FROM ITEMS WHERE BARCODE = '" + barcode + "'";

		//Set up our return item with null by default
		Item returnItem = null;

		try
		{
			//Execute our query
			ResultSet rs = connection.executeQuery(query);
			
			//Check if our query got any results
			if (rs.next())
			{
				//If so, create item instance from result data
				returnItem = new Item(barcode);
				returnItem.setDescription(rs.getString("DESCR"));
				returnItem.setPrice((int)(rs.getDouble("PRICE") * (double)100));
{'fraction_non_alphanumeric': 0.09504950495049505, 'fraction_numerical': 0.0029702970297029703, 'mean_word_length': 3.9656019656019654, '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': '2538276', 'n_tokens_mistral': 637, 'n_tokens_neox': 561, 'n_words': 201}