I was working on a project that missbehaved, for some reasons no exception was thrown even when it should have. Deep down I have found this kind of error handling:
try {
m.invoke(parentObject, paramObj);
} catch (IllegalArgumentException e) {
new CaseLibException(e);
} catch (IllegalAccessException e) {
new CaseLibException(e);
} catch (InvocationTargetException e) {
new CaseLibException(e);
}
My brain recognized that several exceptions were wrapped into another one, so that's not so bad. But I had to stumble over this code at least 3 times to see what's missing...
What is your most stupid bug you could not find?
Debugging, in computer programming and engineering, is a multistep process that involves identifying a problem, isolating the source of the problem, and then either correcting the problem or determining a way to work around it. The final step of debugging is to test the correction or workaround and make sure it works.
I fixed a bug once where the application crashed every day at 6:12pm.
Turned out that someone had stored the number of seconds since the start of the day in a 16bit int.
In C/C++ (which I learned recently)
if (x = 0) {
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With