This is the original line of code:
(SomeArray) someCollection.toArray(new SomeArray)
Intellij recommends to change it to:
(SomeArray) someCollection.toArray(new SomeArray[someCollection.size()])
The explanation given is to avoid heavy taxing on the JVM because of reflection. But the original way I have it, how is that using reflection? I am specifically saying create the array with size of 0 specifically. My question is isnt the first way of writing the code the same as the second way but perhaps even better?