"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 Campbell Ritchie:
Assertions (as opposed to ordinary Exceptions) are there for testing; they should be used only in testing and then disabled in a production application.
When an AssertionError occurs you need to go and find out what happened, and most of the time, correct the code.
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
"I'm not back." - Bill Harding, Twister
Originally posted by Campbell Ritchie:
You can always re-enable the assertions.
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
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
Originally posted by Jim Yingst:
[Pat]: You really should not be calling System.exit(); ever.
You should have a highest level program trap all possible errors, handle them, and return out of the top.
Well in that case, I'm going to disagree with Pat, at least a little. Assertions are often testing such fundamental assumptions that if they're wrong, you're often best off making it really obvious to the user that the program is broken. Fail immediately and loudly. If there are multiple threads going on, as Chris said, then it's quite possible that the AssertionError will terminate one thread (perhaps the GUI event response thread, for example) while leaving other threads running. This in turn may confuse the user and lead to additional errors, and may obscure the true cause of the problems. So I would argue that in such a case, System.exit(1) may be a valid way to handle the error.
"I'm not back." - Bill Harding, Twister
Originally posted by Campbell Ritchie:
Exceptions are there all the time; AssertionErrors have to be explicitly enabled.
I'm tying myself in knots here, aren't I?
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
"I'm not back." - Bill Harding, Twister
Consider Paul's rocket mass heater. |