A closed source WTF: the longest second
OK, since I've pointed out a number of times that open source code contains a number of embarrassing bugs, I want to just emphasize that I've seen embarrassing code in every code base I've examined, including some propriatary closed source code bases.
I just want to share the following code, found in the code base of a highly respected tech company.
private static final String SECOND = "second";
public static String getTimeDelayStr(long delay) {
double roundDelay = 0;
// seconds
if (delay == 1)
return String.valueOf(new Double(Math.ceil(delay)).intValue()) + " " + SECOND;
....