<commit_before>/**
 * 
 */
package gov.nih.nci.cadsr.cdecurate.database;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import org.apache.log4j.Logger;

/**
 * @author asharma
 *
 */
public class SQLHelper {
	 public static final Logger  logger  = Logger.getLogger(SQLHelper.class.getName());
		   
    public static void closePreparedStatement(PreparedStatement ps) {
        if (ps != null) {
            try {
                ps.close();
            } catch (SQLException e1) {
            	logger.error("Failed to close PreparedStatement", e1);
            }
        }
    }
    public static void closeStatement(Statement stmt) {
        if (stmt != null) {
            try {
            	stmt.close();
            } catch (SQLException e1) {
            	logger.error("Failed to close Statement", e1);
            }
        }
    }
    public static void closeResultSet(ResultSet rs) {
        if (rs != null) {
            try {
                rs.close();
            } catch (SQLException e1) {
            	logger.error("Failed to close ResultSet", e1);
            }
        }
       
    }
    
    public static void closeCallableStatement(CallableStatement cstmt) {
        if (cstmt != null) {
            try {
            	cstmt.close();
            } catch (SQLException e1) {
            	logger.error("Failed to close CallableStatement", e1);
            }
        }
    }  
        
    public static void closeConnection(Connection con){
            try
            {
              if (con != null && !con.isClosed())
                    con.close();
            }catch (SQLException e1) {
            	logger.error("Failed to close Connection", e1);
            }catch (Exception e){
                logger.fatal("Error closing the connection ", e);
            }
        }
  
 }
<commit_msg>added comment<commit_after>/**
 * 
 */
package gov.nih.nci.cadsr.cdecurate.database;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import org.apache.log4j.Logger;

/**
 * @author asharma
 *
 */
public class SQLHelper {
	 public static final Logger  logger  = Logger.getLogger(SQLHelper.class.getName());
		   
    /**
     * @param ps
     */
    public static void closePreparedStatement(PreparedStatement ps) {
        if (ps != null) {
            try {
                ps.close();
            } catch (SQLException e1) {
            	logger.error("Failed to close PreparedStatement", e1);
            }
        }
    }
    /**
     * @param stmt
     */
    public static void closeStatement(Statement stmt) {
        if (stmt != null) {
            try {
            	stmt.close();
            } catch (SQLException e1) {
            	logger.error("Failed to close Statement", e1);
            }
        }
    }
    /**
     * @param rs
     */
    public static void closeResultSet(ResultSet rs) {
        if (rs != null) {
            try {
                rs.close();
            } catch (SQLException e1) {
            	logger.error("Failed to close ResultSet", e1);
            }
        }
       
    }
    
    /**
     * @param cstmt
     */
    public static void closeCallableStatement(CallableStatement cstmt) {
        if (cstmt != null) {
            try {
            	cstmt.close();
            } catch (SQLException e1) {
            	logger.error("Failed to close CallableStatement", e1);
            }
        }
    }  
        
    /**
     * @param con
     */
    public static void closeConnection(Connection con){
            try
            {
              if (con != null && !con.isClosed())
                    con.close();
            }catch (SQLException e1) {
            	logger.error("Failed to close Connection", e1);
            }catch (Exception e){
                logger.fatal("Error closing the connection ", e);
            }
        }
  
 }

{'fraction_non_alphanumeric': 0.10969325153374233, 'fraction_numerical': 0.005398773006134969, 'mean_word_length': 1.536403235843186, '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': '4736647', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1125, 'n_words': 265}