From: <one...@us...> - 2003-01-15 10:28:42
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv29686/hibernate/type Modified Files: TimestampType.java Log Message: fixed an NPE when username was not specied fixed a bug in TimestampType Index: TimestampType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/type/TimestampType.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** TimestampType.java 25 Dec 2002 01:02:16 -0000 1.33 --- TimestampType.java 15 Jan 2003 10:28:39 -0000 1.34 *************** *** 2,6 **** package cirrus.hibernate.type; ! import java.sql.*; import java.text.SimpleDateFormat; --- 2,10 ---- package cirrus.hibernate.type; ! import java.sql.PreparedStatement; ! import java.sql.ResultSet; ! import java.sql.SQLException; ! import java.sql.Timestamp; ! import java.sql.Types; import java.text.SimpleDateFormat; *************** *** 34,42 **** public Object deepCopyNotNull(Object value) { - Timestamp copy = new Timestamp( ( (java.util.Date) value ).getTime() ); if ( value instanceof Timestamp ) { ! copy.setNanos( ( (Timestamp) value ).getNanos() ); } - return copy; } --- 38,51 ---- public Object deepCopyNotNull(Object value) { if ( value instanceof Timestamp ) { ! Timestamp orig = (Timestamp) value; ! Timestamp ts = new Timestamp( orig.getTime() ); ! ts.setNanos( orig.getNanos() ); ! return ts; ! } ! else { ! java.util.Date orig = (java.util.Date) value; ! return new java.util.Date( orig.getTime() ); } } |