createJavaObjectArray() is allowed without explicit type arguments
See original GitHub issueAs discussed on gitter, it’s possible to call createJavaObjectArray
without explicit type arguments, which might lead to ClassCastException
s at runtime:
typeParameters => createJavaObjectArray({}); // expected to return `ObjectArray<PsiTypeParameter>`
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lcom.intellij.psi.PsiTypeParameter;
at org.intellij.plugins.ceylon.ide.ceylonCode.lightpsi.CeyLightToplevelFunction.getTypeParameters(CeyLightToplevelFunction.ceylon:155)
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Why can't I create an array of a type parameter in Java?
Array declarations are required to have a reifiable type, and generics are not reifiable. From the documentation: the only type you can ...
Read more >Java Programming Tutorial on Generics
Let us begin with a version without generics called MyArrayList , which is a linear data structure, similar to array, but resizable. For...
Read more >Generic Methods - Java™ Tutorials
Generic methods allow type parameters to be used to express dependencies among the types of one or more arguments to a method and/or...
Read more >The Problem With Creating Generic Arrays - SimplexaCode AG
(It's not allowed, because it doesn't make sense.) Always explicitly providing the class type makes using such a feature very cumbersome. See ...
Read more >Java Part 9 Flashcards | Chegg.com
The second example leaves out the explicit type of the objects being ... specifies that only these kinds of argument types are allowed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here, have a Pony http://www.ponylang.org/
Damnit. This is how we spell it in French 😦