Here's another
interesting piece of code I've just digged up in a C# application I'm reviewing.
If you can come up with a bright idea about what those try/catch blocks are supposed to do, you've got more imagination than me...
class Foo
{
private int bar;
// ...snip...
public int GetNewBar()
{
int ret = 0;
lock (this)
{
try {
bar++;
ret = bar;
}
catch {
try {
bar++;
ret = bar;
}
catch {}
}
}
return ret;
}
// ...snip...
}