https://issues.apache.org/bugzilla/show_bug.cgi?id=49972
--- Comment #1 from Sebb <s...@apache.org> 2010-09-22 06:53:24 EDT --- The currentDateGenerated field is read outside the synch. block, and is not volatile. So if one thread calls getCurrentDate() and updates the field, another thread calling getCurrentDate() may see a stale value. Now a stale value will be smaller than the proper value, so the worst that can happen is that the synch. block is invoked unnecessarily. The synch. block will pick up the true value, and skip the format call if necessary. However, this assumes that the field is only updated by the getCurrentDate() method. As the field is not private, that is not guranteed. Seems to me that the field should be made private, and a comment added to explain why the double-check is OK in this case. If read-only access is needed, a getter could be added for the binary field. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org