Keith Devens .com |
Thursday, March 18, 2010 | ![]() |
| real software ships. – John Gruber | ||
|
| ← Join Java, concurrency extensions to Java | SitePoint Forums - What happened to Object Aggregation? (in PHP) → |

208.28.3.125 wrote:
Keith (http://keithdevens.com/) wrote:
The code will break if the first value of the array is null.
Have you run it? It should just append the string "null". And why only if the first value is null? The code calls StringBuffer.append for all elements, not just the first.
208.28.3.125 wrote:
Hi Keith,
My expected behaviour of the method, which I feel is reasonable - when you encounter a null return empty string.
I saw your comment on http://piehead.livejournal.com/268351.html . Your suggestion was to avoid the flag for the first entry.
if we were to modify your method to behave similar to one I just mentioned, using a flag is easiest way to do it. Please let me know what you think about that?
~Ajay
Keith (http://keithdevens.com/) wrote:
Meh, don't have null strings in your string arrays imo, but you're welcome to modify the above function to do what you'd like.
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):
Generated in about 0.107s.
(Used 8 db queries)
The code will break if the first value of the array is null.
~Ajay