Bug 269083 - Debugger show 'false' instead of NPE
Debugger show 'false' instead of NPE
Status: RESOLVED FIXED
Product: debugger
Classification: Unclassified
Component: Java
8.2
PC Linux
: P3 (vote)
: 8.2
Assigned To: Martin Entlicher
issues@debugger
82patch1-fixed
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-23 06:35 UTC by xtron
Modified: 2016-12-16 20:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
screenshot (18.58 KB, image/png)
2016-11-23 06:35 UTC, xtron
Details
Is >< better value now? (122.82 KB, image/png)
2016-12-13 15:11 UTC, Jiri Kovalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description xtron 2016-11-23 06:35:09 UTC
Created attachment 162991 [details]
screenshot

This code throws NPE. But debugger watch window show 'false'

public class ClassTest {

    public static short myConst = 1;

    public static Short getValue() {
        return null;
    }

    public static void main(String[] args) {

        if (getValue()==myConst) {   //This string throws NPE because unboxing                   getValue give us null  
            System.out.println("OK");
        }
    }
}
Comment 1 Martin Entlicher 2016-12-06 07:17:01 UTC
Reproduced.
Comment 2 Martin Entlicher 2016-12-07 08:24:37 UTC
Fixed by changeset:   302088:f6ae9ddea792
Comment 3 Martin Entlicher 2016-12-09 10:24:21 UTC
Transplanted to release82:
http://hg.netbeans.org/releases/rev/5382bb35d91e
Comment 4 Jiri Kovalsky 2016-12-13 15:11:56 UTC
Created attachment 163221 [details]
Is >< better value now?

What did change with this fix? xtron, can you please verify this? Thanks.
Comment 5 xtron 2016-12-16 20:06:22 UTC
I think it should be text of real NullPointerException like:

Exception occurred in target VM:  
java.lang.NullPointerException: 
<stacktrace>


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo