It's ok. Each class in a package will make this call, but only the
first class that is loaded in a given package will cause the key to be
stored for a new StringManager for that package. Every class in that
package after the first will see that the key is already in the map,
so no new StringManager is created. My guess is that somehow your
breakpoint occurred after the first class in the package made the call
- so the key you were looking was in the map already.
Rob
On 5/28/07, pjsong <pjsong3101@...> wrote:
> Sorry i don't get the idea very much. When debugging I have traced from code in class Application
>
> private static final StringManager s_stringMgr =
> StringManagerFactory.getStringManager(<class>)
>
> to code in class StringManagerFactory
>
> StringManagerFactory.getStringManager(clazz){}
>
> Through Watch, I noticed that Map s_mgrs has got its key-value upon debug's entering this call. But there has no one line been executed yet. how s_mgrs get its value?
> Thank you very much !
>
>
> ----- Original Message -----
> From: "Robert Manning" <robert.m.manning@...>
> To: "pjsong" <pjsong3101@...>
> Cc: <squirrel-sql-develop@...>
> Sent: Monday, May 28, 2007 10:33 PM
> Subject: (????-??????????)Re: [Squirrel-sql-develop] question about StringManagerFactory's Map
>
>
> > On 5/28/07, pjsong <pjsong3101@...> wrote:
> > > File StringManagerFactory has a member s_mgrs , i know it's a collection of StringManager objects keyed by javapackage name, but i don't know when this HashMap was initialized. when the key and it's value was added.
> >
> > The StringManager for a given package is initialized when the first
> > class in that package is statically initialized if the class has a
> > class variable declared such as :
> >
> > private static final StringManager s_stringMgr =
> > StringManagerFactory.getStringManager(<class>)
> >
> > Search the source code for the variable named s_stringMgr - you will
> > find many examples.
> >
> > Rob
> >
|