<commit_before>package cn.ce.binlog.mysql.event;

import java.sql.Types;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

@XmlAccessorType(XmlAccessType.FIELD)
public class ColumnInfoValue {
	private String columnName;
	private boolean isPrimaryKey;
	private int index;
	private boolean isNull;
	private boolean isBinary;
	private int javaType;
	private String columnType;
	private String value;
	private boolean isAfter;

	public Object getReadValue() {
		Object obj = null;
		if (value == null) {
			return value;
		}
		try {
			switch (javaType) {
			case Types.DATE:
				// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
				// Date date = sdf.parse(value);
				java.sql.Date date = java.sql.Date.valueOf(value);
				obj = date;
				break;
			case Types.TIMESTAMP:
				java.sql.Timestamp datetime = java.sql.Timestamp.valueOf(value);
				obj = datetime;
				break;
			case Types.INTEGER:
				obj = new Integer(value);
				break;
			case Types.BIGINT:
				obj = new Long(value);
				break;
			case Types.DOUBLE:
				obj = new Double(value);
				break;
			case Types.FLOAT:
				obj = new Float(value);
				break;
			case Types.DECIMAL:
				obj = new Double(value);
				break;
			case Types.BOOLEAN:
				obj = new Boolean(value);
				break;
			default:
				obj = value;
				break;
			}
		} catch (Throwable ex) {
			System.err.println("ex--------:" + ex.getMessage());
			System.err.println("javaType:" + javaType);
			System.err.println("value:" + value);
			obj = value;
			ex.printStackTrace();
		}
		return obj;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public boolean isPrimaryKey() {
		return isPrimaryKey;
	}

	public void setPrimaryKey(boolean isPrimaryKey) {
		this.isPrimaryKey = isPrimaryKey;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public boolean isNull() {
		return isNull;
	}

	public void setNull(boolean isNull) {
		this.isNull = isNull;
	}

	public boolean isBinary() {
		return isBinary;
	}

	public void setBinary(boolean isBinary) {
		this.isBinary = isBinary;
	}

	public int getJavaType() {
		return javaType;
	}

	public void setJavaType(int javaType) {
		this.javaType = javaType;
	}

	public String getColumnType() {
		return columnType;
	}

	public void setColumnType(String columnType) {
		this.columnType = columnType;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public boolean isAfter() {
		return isAfter;
	}

	public void setAfter(boolean isAfter) {
		this.isAfter = isAfter;
	}

	@Override
	public String toString() {
		String s = ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
		return s;
	}

	public static void main(String[] args) {
		try {
			String value = "2014-02-09";

			// Date date = java.sql.Date.valueOf(value);

			System.out.println(java.sql.Timestamp.valueOf(value));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}<commit_msg>JDK版本导致 Error Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]<commit_after>package cn.ce.binlog.mysql.event;

import java.sql.Types;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

@XmlAccessorType(XmlAccessType.FIELD)
public class ColumnInfoValue {
	private String columnName;
	private boolean isPrimaryKey;
	private int index;
	private boolean isNull;
	private boolean isBinary;
	private int javaType;
	private String columnType;
	private String value;
	private boolean isAfter;

	public Object getReadValue() {
		Object obj = null;
		if (value == null) {
			return value;
		}
		try {
			switch (javaType) {
			case Types.DATE:
				// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
				// Date date = sdf.parse(value);
				java.sql.Date date = java.sql.Date.valueOf(value);
				obj = date;
				break;
			case Types.TIMESTAMP:
				SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
				java.util.Date dateTs = df.parse(value); 
				String time = df.format(dateTs); 
				java.sql.Timestamp datetime = java.sql.Timestamp.valueOf(time);
				obj = datetime;
				break;
			case Types.INTEGER:
				obj = new Integer(value);
				break;
			case Types.BIGINT:
				obj = new Long(value);
				break;
			case Types.DOUBLE:
				obj = new Double(value);
				break;
			case Types.FLOAT:
				obj = new Float(value);
				break;
			case Types.DECIMAL:
				obj = new Double(value);
				break;
			case Types.BOOLEAN:
				obj = new Boolean(value);
				break;
			default:
				obj = value;
				break;
			}
		} catch (Throwable ex) {
			System.err.println("ex--------:" + ex.getMessage());
			System.err.println("javaType:" + javaType);
			System.err.println("value:" + value);
			obj = value;
			ex.printStackTrace();
		}
		return obj;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public boolean isPrimaryKey() {
		return isPrimaryKey;
	}

	public void setPrimaryKey(boolean isPrimaryKey) {
		this.isPrimaryKey = isPrimaryKey;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public boolean isNull() {
		return isNull;
	}

	public void setNull(boolean isNull) {
		this.isNull = isNull;
	}

	public boolean isBinary() {
		return isBinary;
	}

	public void setBinary(boolean isBinary) {
		this.isBinary = isBinary;
	}

	public int getJavaType() {
		return javaType;
	}

	public void setJavaType(int javaType) {
		this.javaType = javaType;
	}

	public String getColumnType() {
		return columnType;
	}

	public void setColumnType(String columnType) {
		this.columnType = columnType;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public boolean isAfter() {
		return isAfter;
	}

	public void setAfter(boolean isAfter) {
		this.isAfter = isAfter;
	}

	@Override
	public String toString() {
		String s = ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
		return s;
	}

	public static void main(String[] args) {
		try {
			String value = "2050-00-00 00:00:00";

			// Date date = java.sql.Date.valueOf(value);
			SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
			java.util.Date dateTs = df.parse(value); 
			String time = df.format(dateTs); 
			java.sql.Timestamp datetime = java.sql.Timestamp.valueOf(time);
			System.out.println(datetime);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
{'fraction_non_alphanumeric': 0.11484672976409098, 'fraction_numerical': 0.0031077835852521543, 'mean_word_length': 3.4895370957514267, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 1, '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': '972536', 'n_tokens_mistral': 2697, 'n_tokens_neox': 2335, 'n_words': 565}