String s = "";
for (int i = 0; i < args.length; i++) {
s += array[i];
}
Now, as soon as I looked at that I immediately thought "well, they're not putting anything in between the params when they concatenate them", e.g. I would expect to see: s += array[i] + "\t";
(or a comma or newline instead of a tab)My next thought was "what happens if there are no args?" E.g. args.length returns 0, and they try to access the first element in the list (due to heritage from c pointers we start counting at 0) which is the 'zeroth' one, which doesn't exist... it should throw an array out of bounds exception.
-----
The reason I ask, is that based on the comments, the people reading the blog think the problem is in the operator overloading. Are they expecting this iteration through the args list to sum the args, and then assign the sum to the string?
If so, then I don't see how the bug could remain undetected:
"it could take weeks to get a bug report, and weeks more to get a fix ready"
Whereas in the unlikey event that I'm right, I still don't see how it would be hard to fix?
What am I missing?