* The as-of date for the currently open log file, or a zero-length
* string if there is no open log file.
*/
- private String dateStamp = "";
+ private volatile String dateStamp = "";
/**
*/
private Date currentDate = null;
- private long currentMillis = 0;
+ private volatile long currentMillis = 0;
/**
}
/* Make sure date is correct */
- currentDate = new Date(System.currentTimeMillis());
- dateStamp = fileDateFormatter.format(currentDate);
+ dateStamp = fileDateFormatter.format(
+ new Date(System.currentTimeMillis()));
open();
return true;
long systime = System.currentTimeMillis();
if ((systime - rotationLastChecked) > 1000) {
- // We need a new currentDate
- currentDate = new Date(systime);
rotationLastChecked = systime;
// Check for a change of date
- String tsDate = fileDateFormatter.format(currentDate);
+ String tsDate = fileDateFormatter.format(new Date(systime));
// If the date has changed, switch log files
if (!dateStamp.equals(tsDate)) {
}
/* Make sure date is correct */
- currentDate = new Date(System.currentTimeMillis());
- dateStamp = fileDateFormatter.format(currentDate);
+ dateStamp = fileDateFormatter.format(
+ new Date(System.currentTimeMillis()));
open();
}