|
"I'm not back." - Bill Harding, Twister
"I'm not back." - Bill Harding, Twister
Originally posted by Jim Yingst:
[QB]You were talking about a singleton. Now you're talking about three different classes. Is one of them a singleton? All of them? Should I just forget about the singleton? I'm still confused.
From your stack trace, it sounds like you should look at PersistentBusinessObject.java line 135. That should be what's calling the newInstance() method. If not, then what is at that line?
Regarding Advanced: yeah, we really do have a shortage of even halfway-decent problems in that forum. I'm not sure why this one was bounced. Maybe an overly-quick read of the topic led to a misunderstanding? I dunno.
Incidentally your mention of the "double-check lock trick" concerns me a bit. Using a private constructor and a private static variable is pretty much the standard way to make a singleton
"I'm not back." - Bill Harding, Twister
Originally posted by Jim Yingst:
So are you saying that AFrameDefaultLocation is the singleton that you were previously talking about? Is that the class that has the private
I guess I'm still not understanding what the question is here. Is the problem that you don't understand how it is that the newInstance() method is being called? Or why it is that you should not call newInstance() on a class with a private constructor? Or are you trying to find a workaround to, yes, call newInstance() (or something like it) on a class with a privzte constructor?
Rather, it's an alternative to double-checked locking, called the Initialization on demand holder idiom..[/QB]
"I'm not back." - Bill Harding, Twister
Originally posted by Jim Yingst:
Is this code that you have access to, or not? Personally I have no way of knowing what this code does (other than guessing based on the method and class names) but this is where I would look to understand why and how this code is being called.
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
"I'm not back." - Bill Harding, Twister
Originally posted by Jim Yingst:
Well, if Pat is trying to understand how and why the newInstance() is being called,
I've checked and there are no calls to the constructor and no explicit calls to newInstance() on the class.
I've checked and there are no calls to the constructor and no explicit calls to newInstance() on the class.
That is the newInstance() call that is blowing up. It should not be calling it, but I can't figure out why.
"I'm not back." - Bill Harding, Twister
Is there code somehwere that is supposed to detect whether an instance is already available, without creating it? Where is that code? Maybe it's got a bug.[/QB]
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Don't get me started about those stupid light bulbs. |