![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY92RX5XQFuRObC6e8QomDEh-xgwmwo12Khswec4UhJ-1kCtoPqVt8T5vbqB_WOzH9opdhyphenhyphenDWTw9LBAZComFPSM8WM6o3C2B1-2aruxL21Ll0UGrD0GMf-9_fVEpai0dmKwJRJCCOKfmZW/s320/millis_per_screenshot.png)
I grabbed some time formatting code from an older project of mine to use in my current project.
However, I noticed that the constants defined at the top of the class had some weird values. The constant, number of milliseconds per whatever, was ending in a 1 instead of a 0. My first thought was that a co-worker had mangled my source to fix some stupid off-by-one time issue they were having, incidentally breaking everything else that relied on that constant.
While 600 to 601 is a plausible change, 60 milliseconds per minute to 600 milliseconds per minute should have set off alarm bells in my head.
I spent several minutes grepping through the svn repository trying to find the lazy rat-bastard that had messed with my code, only to find that it wasn't a '601' but a '60l' (60L). The L is there to force the value into a long integer type.
Lesson learned? Use uppercase L.
No comments:
Post a Comment