"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 Purushothaman Thambu:
You haven't explained what you are looking for apart from robust collection.
- What is collections used for in your code (What objects are stored)
- Which collection you app is using currently
- What problem are you facing
By the way if you are looking for collections source code you can find them in src.zip file in the jdk home directory.
"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."
Originally posted by Jim Yingst:
Can you show us what it is you're doing at WordCount.java line 521?
classes small and simple wherever possible, and making a class longer is not in general any guarantee of robustness
(snipped)......
"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."
Originally posted by Jim Yingst:
Can you show us what it is you're doing at WordCount.java line 521? And maybe some additional lines around that area, for context.
Ummm... OK. That seems a bit suspicious to me, as I strongly favor keeping classes small and simple wherever possible, and making a class longer is not in general any guarantee of robustness. Often it can lead to the opposite effect.
Also, I would note that it's pretty rare in my experience that the alleged "thread safety" you get from Collections.synchronizedXXX(), or from Vector and Hashmap, is good enough to actually make your code thread-safe. Typiclly there are places where you need to prevent other threads from cutting in in between two different synchoronized method invocations - this means you need additional synchronization outside the methods themselves. And if you're going to do that, why bother using synchronizedXXX() at all? It just confuses the issue by putting some synchronization inside the XXX class, while other synchonization is in the clas that uses the XXX. Feh. Just put it all in the class that uses it. Many, many bugs have been committed by people relying on the false promise of "thread safety" from synchronizedXXX() etc.
All of life is a contant education - Eleanor Roosevelt. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|