<commit_before>/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2006, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |                                         **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

// $Id:Factory.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $


package scala.dbc.datatype;


import java.sql.Types._;
import java.math.BigInteger;
import java.math.BigDecimal;

object Factory {

  final val java_lang_Integer_SIZE = 32;
  final val java_lang_Long_SIZE    = 64;

  /** Returns a mullable property formated as a boolean option */
  def isNullable (metadata:java.sql.ResultSetMetaData, index:Int): Option[scala.Boolean] =
    metadata.isNullable(index) match {
      case java.sql.ResultSetMetaData.columnNoNulls => Some(false);
      case java.sql.ResultSetMetaData.columnNullable => Some(true);
      case java.sql.ResultSetMetaData.columnNoNulls => None;
    }

  /** Returns the binary precision for an integer field. This should only be
   * used to find precision for integer numbers. It assumes that
   * bytes cannot be used partially (result % 8 = 0). */
  def bytePrecision (precision:Int, signed:scala.Boolean, safe:scala.Boolean): Int = {<commit_msg>commented out case with unreachable code<commit_after>/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2006, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |                                         **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

// $Id:Factory.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $


package scala.dbc.datatype;


import java.sql.Types._;
import java.math.BigInteger;
import java.math.BigDecimal;

object Factory {

  final val java_lang_Integer_SIZE = 32;
  final val java_lang_Long_SIZE    = 64;

  /** Returns a mullable property formated as a boolean option */
  def isNullable (metadata:java.sql.ResultSetMetaData, index:Int): Option[scala.Boolean] =
    metadata.isNullable(index) match {
      case java.sql.ResultSetMetaData.columnNoNulls => Some(false);
      case java.sql.ResultSetMetaData.columnNullable => Some(true);
      //case java.sql.ResultSetMetaData.columnNoNulls => None; // bq:unreachable code
    }

  /** Returns the binary precision for an integer field. This should only be
   * used to find precision for integer numbers. It assumes that
   * bytes cannot be used partially (result % 8 = 0). */
  def bytePrecision (precision:Int, signed:scala.Boolean, safe:scala.Boolean): Int = {
{'fraction_non_alphanumeric': 0.11164427383237364, 'fraction_numerical': 0.026871401151631478, 'mean_word_length': 1.49561053471668, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6258339', 'n_tokens_mistral': 916, 'n_tokens_neox': 823, 'n_words': 199}