JDK-4834738 NullPointerException: Better info
fuudtorrentsru at gmail.com
Tue Apr 15 07:16:39 UTC 2014
What is the best way to submit patch?
Currently you can see it at https://gist.github.com/Fuud/10709048
>>Can you explain what information you add?
This java code will produce NPE;
Before patch exception stack trace looks like this:
After patch if code is executing by interpreter NPE will have additional
java.lang.NullPointerException: can not invoke method
java.lang.String.length()I on null object
This additional information can help to understand cause of NPE in case of
call chains. For example, let we have java code
if we get NPE without message we can not understand is a==null or
a.b()==null. After patch we will get enough information:
java.lang.NullPointerException: can not invoke method A.b() on null object
So we can understand that a is null.
2014-04-15 10:32 GMT+04:00 David Holmes <david.holmes at oracle.com>:
> Hi Fedor,
> On 14/04/2014 1:09 AM, Fedor Bobin wrote:
>> Can you please review patch for JDK-4834738.
> Patches are stripped when sent as attachments.
> Currently I added more information to NPE if it is handled by interpreter
>> or template interpreter on x86-64. On other platforms and after
>> jdk will handle NPE as usual.
> Can you explain what information you add?
More information about the hotspot-dev