staticanalysis / data-race-test

Automatically exported from code.google.com/p/data-race-test
0 stars 0 forks source link

Replace all asserts in ThreadSanitizerTest with proper checking and exception throwing #35

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Assertion statements make sense when we want to run a program in two modes:
debug and release. In tests we only have debug mode.

It is rather easy to get caught by not running a JVM with -ea and missing
important tricky errors (including VerifyError) because exception handlers
do just asserts. Bad style.

Anytime somebody has an empty catch clause they should have a creepy
feeling. There are definitely times when it is actually the correct thing
to do, but at least you have to think about it. In Java you can't escape
the creepy feeling.
- James Gosling

Original issue reported on code.google.com by egor.pasko@gmail.com on 29 Apr 2010 at 2:04