News for hackers. Stuff that matters.
Re:JITs are un-ergonomic by imtringued on Sunday March 29, 2020 @09:23AM (#22718783)
Java is only throwing generic type information away in the declaration of classes and methods. The code that is accessing generic types is compiled with casts to the expected type. List<String>.get(1) will generate a cast to String therefore nothing is actually missing in the generated code. It is only missing when you use reflection to e.g. deserialize a List via Jackson by passing List<String>.class. That unfortunately won't work because the generic type parameter is not part of the declaration, only the generated code.

There are no comments on this comment yet.