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

Summary: Debugger show 'false' instead of NPE
Product: debugger Reporter: xtron
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: screenshot
Is >< better value now?

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>