- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Slow day, Remy?
Admin
In Java you cannot create an array of a generic type.
new ArrayList<String>[0]will give a compiler errors. They could have added a generic type on the variable type, but the following gives an unchecked conversion warning:ArrayList<String> data = new ArrayList[dataList.size()].And of course extra penalty-points for declaring it as
ArrayListinstead ofList.Admin
My bet is homebrew serialization is the next step
Admin
Well, they have to declare
ArrayListas non-generic here to create an array, as Java doesn't allow creating arrays of generics.But if they really wanted a list of lists, they could have created a
List<List<Something>>without bothering with arrays. Arrays are a low-level language feature that are mostly useful for working with binary data and implementing collections.Admin
It's the return of the arrject! https://thedailywtf.com/articles/arrject
Admin
Funny... I see lists of arrays fairly often, but arrays of lists is more of a novelty.
And no, it doesn't bode well for the quality of the rest of the code.
Admin
This is a perfect one-line WTF Chef's kiss
Admin
Funny how the arrject pattern is nowadays called "DataFrame".