What this tells me is that keygendep.jar is the last element read in from the xml file and when class PluginHandler adds each new PluginEntry to the ArrayList, it is overwriting all the elements in the list with the same last element information. I can't figure out why that is? I've gone over the code in DEBUG mode in Eclipse but nothing jumps out at me as to what is going wrong. The println statements tell the tale in the character() method. Everytime I create a new instance of PluginEntry, I also print out the values of the previous PluginEntry from the ArrayList. The previous one is definitely being overwritten. The problem must lie in the PluginHandler class somehow. Please advise.
Alan Shiers wrote:when class PluginHandler adds a new PluginEntry to the ArrayList it is overwriting all the elements in the list with the same last element information.
As soon as I saw this I knew I was searching for the word "static". And sure enough, your class-level variables in PluginEntry are declared static. So all PluginEntry instances share the same value of name and destination folder.
Joined: Sep 24, 2003
Damn your good! You were right. I got rid of the "static" declarations in PluginEntry. It worked fine after that. Lesson learned.