Shared libraries
Shared libraries
Posted Nov 27, 2025 16:54 UTC (Thu) by ssmith32 (subscriber, #72404)In reply to: Shared libraries by Cyberax
Parent article: APT Rust requirement raises questions
You can definitely have code that does:
for( var a: someCollection<SomeTypeA> )
And it ends up with someCollection<SomeTypeB> at runtime, and you're stuck debugging the damnedest runtime error, once you do something with it in the for loop..
I had this happen on a nested, templated collection.
Granted, the thing that usually triggers this is the odd corner case of deserializing data back into Java.
Unfortunately, this odd corner is something that happens all over the place when you're working with a system that contains HTTP services, which, if you work with Java, is what you're usually paid to do, nowadays.
And, since you always need some sort of deserializer for JSON (or, if you're particularly unlucky, XML) in your HTTP service, oh, what the heck, we'll use it for config files as well, for any data we read in, for..
And Boom.
When working with Java on a daily basis, type erasure is anything but an implementation detail.
It's is a very real pain point (granted it was done by smart people with sound reasoning and good intentions [1], but you know what they say about good intentions...)
There are other cases I've ran into at odd times, but I have trouble recalling the specifics, because the serde issue happens often enough that it looms large in the memory.
[1] https://openjdk.org/projects/valhalla/design-notes/in-def...
