This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 269083 - Debugger show 'false' instead of NPE
Summary: Debugger show 'false' instead of NPE
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-23 06:35 UTC by xtron
Modified: 2016-12-16 20:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


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>