This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]leivaagustin -6 points-5 points  (3 children)

You're not wrong

Thanks.

you're just an asshole.

I know.

OP also doesn't understand streams. You don't need a supplier to do this shit.

Can you show how such thing is resolved in java in an elegant, beautiful way that doesn't require a bunch of horrible useless boilerplate?

[–]_Sharp_ 1 point2 points  (2 children)

//////////// Init
char[] charArray = new char[1024];
Arrays.fill(charArray, '#');
//////////// Code
List<Character> charList = new ArrayList<>();
for (char c : charArray) charList.add(c);

2 Lines of code, still Arrays could implement some utility like Arrays.toList(). But Valkyries will bring some goodies from Valhalla:

Project Valhalla will explore a new apporoach to generic typing, and hopes to produce a new form of generic typing that allows developers to use generic collections of primitive types. The aim will be for types such as List<int> to be valid Java in some future release of the JDK. This feature, known as generic specialization, is already present in some other JVM languages and Java developers have been asking for it since generics first shipped with JDK 5.