[ openjms-Bugs-1040962 ] Singleton pattern not implemented properly in DestinationMan
"SourceForge.net" <[email protected]> Wed, 16 Feb 2005 05:20:05 -0800
| Newsgroups | gmane.comp.java.openjms.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #1040962, was opened at 2004-10-06 06:19 Message generated for change (Comment added) made by tanderson You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=474136&aid=1040962&group_id=54559 Category: None Group: v0.7.6.1 Status: Open Resolution: None Priority: 5 Submitted By: kungfucode (kungfucode) Assigned to: Nobody/Anonymous (nobody) Summary: Singleton pattern not implemented properly in DestinationMan Initial Comment: The _instance member is declared static, however, multiple calls to createInstance will continually create new DestinationManager objects and assign their references to _instance. With createInstance being callable from anywhere, it is public after all, this leaves the door open for potentially difficult to diagnose concurrency issues down the road. Recommend checking for null value in createInstance and only creating a new object if the Singleton reference _instance has yet to be initialized. Also recommend synchronizing the method createInstance to protect against problems stemming from calls to the method by multiple threads. ---------------------------------------------------------------------- >Comment By: Tim Anderson (tanderson) Date: 2005-02-17 00:20 Message: Logged In: YES user_id=557161 This is a known issue. For the next major release, the plan is to remove all singletons. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=474136&aid=1040962&group_id=54559 ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click