From: Erik V. <eri...@hc...> - 2008-12-02 20:13:34
|
I have adjusted my copies of the various classes to resolve this Null Pointer Exception, by creating constructors for the Round, StockRound, OperatingRound and the sub-classes of StockRound. It does require modifications of all of these for the constructors. A total of 8 classes to update. (the sub-classes of OperatingRound does not require an update. But probably should have constructors created for consistancy's sake. The simple fix would have been to add this.companyManager = gameManager.getCompanyManager(); to the ShareSellingRound constructor. That works for me to fix the problem (which I have reproduced). Not sure what you are trying to achieve by adding all these constructors. As for the second suggestion, I have indeed implemented the constructors such that the super-classes do all the initialization that should, and the sub-classes do the initialization they should. In a couple of places I needed to create a constructor that simply called the super class constructor and nothing more. I wonder why you are using worls like "required" and "needed": such default constructors can be omitted. I have noticed that XCode does warn about several classes marked as deprecated (in your comments) that are still being used. But the deprecation comment does not specify what should be used instead. Those might be a better item to clean up then simply adding JAVA Docs. Good point. Thanks. Erik. |