« Return to Thread: Singleton TopComponents are called twice

Re: Re: Singleton TopComponents are called twice

by tomwheel :: Rate this Message:

Reply to Author | View in Thread

If this is true, it is almost certainly a bug.  I tried, but failed,
to reproduce this in 6.7 RC3 based on what you said.  It's possible
that I overlooked some detail of what you did or that there is a bug
which only affects certain configurations.

As the very definition of Singleton implies, there should only be one
instance created.  If you've observed this on what is basically an
unmodified TopComponent as generated by the wizard, then please file a
bug report on it.

On Fri, Jun 19, 2009 at 12:34 PM, Dan Dubois<uvicoxpz@...> wrote:

> I should clarify; when I say my singleton TopComponents are being
> called twice I mean two instances of each TopComponent are being
> created through their public no argument constructors.
>
> 2009/6/19 Dan Dubois <uvicoxpz@...>:
>> Hi All,
>>
>> I have a NetBeans 6.7 RC3 platform application. I registered some
>> listeners on an object in my TopComponent's constructor and realised
>> they were being registered twice.
>>
>> I discovered this was because all my singleton TopComponents are
>> called twice during my platform application start up. Once via
>> reflection, and the second via the getDefault() boilerplate code that
>> NetBeans generates.
>>
>> Is this normal behavior? I can't find anything about it on the web...
>>
>> Best wishes,
>> Dan
>>
>



--
Tom Wheeler
http://www.tomwheeler.com/

 « Return to Thread: Singleton TopComponents are called twice