Often in Java program stack trace, you will see some stack frames include a source line number, while some only say “compiled code”. This is because the stack frames without line numbers have been compiled by the JIT compiler, and the JIT compiler obliterates line number information when it compiles code.
11 February 2004
|
By Bennett
|
Topics: Java, Testing
|
While a Java program is running in a console window, you can can get a stack dump of the program at any time, while it is running. This is very useful for debugging, especially for heavily multithreaded programs.
25 November 2003
|
By Bennett
|
Topics: Java, Testing
|
Depending on the version of the Java runtime and the location of the host, the Java Date and Calendar routines may take daylight savings time into account. For example:
18 November 2003
|
By Bennett
|
Topics: Java, Risks
|
java.sql.Date stores only date information, not times. Simply converting a java.util.Date into a java.sql.Date will silently set the time to midnight. So, to store date/times to be manipulated as java.util.Date objects, don’t do this:
// BUG: loses time of day
preparedStatement.setDate(1, new java.sql.Date(date.getTime()));
do this instead:
preparedStatement.setTimestamp(1, new java.sql.Timestamp(date.getTime()));
java.sql.Timestamp extends java.util.Date, but it should not be used as a [...]
14 August 2003
|
By Bennett
|
Topics: Java, Risks
|