Hoping someone might be able to offer a suggestion as to why I'm getting some very odd behaviour... In short it seems when I access a Date object through a seperate Thread.. the Date is being modified... somehow...??/
Basically my scenario is that I'm developing a JSF based app that uses multiple Threads to seperate the processing of my data to give response back to the user.. I have a ArrayList<MyObject> and MyObject contains a java.util.Date, say called myDate.... I have a kind of wizard approach going on where the user can upload a text file for parsing.. I then show the results which they can modify certain parts, and then they can run another process to process and persist the data to the database.
All is good until I get to the final stage where I'm about to persist the data.. The first set of objects (about 20) in my ArrayList 'lose' their Time information from the Date.. i.e the time will be 0:00:00..
Now I've got a Test package which calls the routine that generates this ArrayList of objects, and after the test I go through the list outputting a toString() on each object.. All the dates are there and correct.. So the passes...
So back to testing using the webapp... As I said I'm using JSF and I've also done a test where as soon as the user clicks on the process button.. I again go through the List and output each item as its toString() and thats OK.. BUT the next part is where I create a new Thread and immediately, actually in the constructor of the Thread (Runnable inner class) ... I AGAIN go through the list... and lo and behold the first 30 or so objects in the exact same list seem to have had their Time data stripped from the Data..