Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
"You can achieve a simple performance improvement by placing the try-catch block outside any loops. On some JVMs, this can amount to as much as a 10 percent increase in performance."
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0672324261/ref=jranch-20" target="_blank" rel="nofollow">Ant Developer's Handbook</a>
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
"I'm not back." - Bill Harding, Twister
Peter, I was just trying to illustrate the only reason you would have a try/catch block within the loop, and that is so that you can keep looping, it had no reference to your original examples.Originally posted by Peter Chase:
...I believe that this means that my two examples were functionally identical...
"I'm not back." - Bill Harding, Twister
Originally posted by Jim Yingst:
I just can't understand WHY you would want catch an exception, only to rethrow it without any other type of error processing.
You may be implementing an interface (or overriding a method declaration) which does not allow the original exception to be thrown, so you are converting the original exception to an acceptable type (e.g. RuntimeException). This may or may not be a good idea from a design perspective - it often indicates the original method declaration was flawed. But sometimes you've just got to work with that declaration anyway...
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Yup, yup, yup. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|