4 ms·
yes, so are the NPEs - both are runtime errors indicating a bug in the code. NPE was a major source of irritation 20 years ago, but what many people do not know
by ivan_gammel 18d ago
yes, so are the NPEs - both are runtime errors indicating a bug in the code. NPE was a major source of irritation 20 years ago, but what many people do not know is that debugging NPEs in Java is easier now - they carry more information about the source. And the culture has evolved.
- cesarb 18d ago> but what many people do not know is that debugging NPEs in Java is easier now - they carry more information about the source Unfortunately, no, they don't. Not after your application has been running for a while; newer JVMs arbitrarily decide you don't need the stack trace anymore, and all you see in your logs is "NullPointerException" (unless you still have the logs from several weeks ago, just after the last JVM restart, which might still have the full stack trace). Older JVMs were better, since they always had the full stack trace; debugging NPEs was easier with them.
- gf000 17d agoI think parent was referring to this: https://www.baeldung.com/java-14-nullpointerexception https://www.baeldung.com/java-14-nullpointerexception