5 ms·
Anybody knows if/when Java will have this feature?
by iamcreasy 10y ago
Anybody knows if/when Java will have this feature?
- meddlepal 10y agoI doubt believe it will ever or at least not anytime soon. I don't think the JVM preserves identifier names in the bytecode in a way that it can be accessed easily. Though I do recall a long time ago reading about some JVM switches that allow that data to be accessed but with performance issues. Can't recall where I read that.
- kodfodrasz 10y agoSadly (as one developing a lot in Java) i think it won't happen anytime soon, and the community will ideologize it as "it is even better that we don't have it". :( I hope I will be wrong. ps: a language where non-nullable references are the thing would be the best.
- lmm 10y agoJava has finally got options, so at least it's theoretically possible to start a migration path to non-nullable. It will take decades though.
- kodfodrasz 10y agoI tried to use the java Optional<T>, but the API has some points, which make it inconvenient for some usecases. (Some of these are addressed in Java 9) As I see: unfortunately without algebraic types you cannot solve this properly, even if you address the lacking points in Optional<T>
- benjiweber 10y agoSAP's JVM implementation has NullPointerExceptions that tell you where the null originated from, which is neat. See slide 17 of https://oracleus.activeevents.com/2014/connect/fileDownload/session/49D67EA3D0EF2126B5B85D06522202C0/CON3243_Simonis.pdf https://oracleus.activeevents.com/2014/connect/fileDownload/...