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 174727

Summary: NPE in OQL Console
Product: profiler Reporter: Jiri Sedlacek <jis>
Component: EngineAssignee: Tomas Hurka <thurka>
Status: RESOLVED FIXED    
Severity: blocker Keywords: VISUALVM
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: heap dump

Description Jiri Sedlacek 2009-10-16 11:02:59 UTC
Some heap dumps appear to be kind of broken, String.value contains null for some instances. This almost consistently
happens for me when dumping from JDK 6u16.

The problem is that for some OQL queries this could cause a NPE being thrown from the HeapWalker which is not very nice.
Try to run the following query for the attached heap dump:

  select toHtml(a) + " = " + a.toString() from java.lang.String a where a.hash == 0

A workaround seems to be using this modified query:

  select toHtml(a) + " = " + a.value.toString() from java.lang.String a where a.hash == 0

which reports javax.script.ScriptException in the Query Results view but doesn't affect the HeapWalker itself.
Comment 1 Jiri Sedlacek 2009-10-16 11:04:57 UTC
Created attachment 89603 [details]
heap dump
Comment 2 Tomas Hurka 2009-10-16 14:13:28 UTC
Fixed in profiler-main

changeset:   149337:09ba11a09821
user:        Tomas Hurka <thurka@netbeans.org>
date:        Fri Oct 16 15:11:29 2009 +0200
summary:     bugfix #174727, value field in String instacne can be null
Comment 3 Quality Engineering 2009-10-17 11:27:37 UTC
Integrated into 'main-golden', will be available in build *200910170201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/09ba11a09821
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #174727, value field in String instacne can be null