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 39952 - Highlighted code not evaluated if value is from other class
Summary: Highlighted code not evaluated if value is from other class
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 4.x
Hardware: PC Other
: P3 blocker (vote)
Assignee: Maros Sandor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-11 09:56 UTC by bht
Modified: 2010-04-29 09:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Main class (611 bytes, text/plain)
2004-02-11 09:59 UTC, bht
Details
Class with external value (83 bytes, text/plain)
2004-02-11 10:07 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2004-02-11 09:56:33 UTC
When inside the same method, the following three
statements are coded, only the first two are
evaluated with the highlight method:

String test1 = String.valueOf('t');// works
String test2 = String.valueOf(TEST_CHAR);// works
String test3 =
String.valueOf(OtherClass.CONSTANT_CHAR);// Does
not work

The highlighted portion is as follows (example):
|OtherClass.CONSTANT_CHAR|
Comment 1 bht 2004-02-11 09:59:22 UTC
Created attachment 13368 [details]
Main class
Comment 2 bht 2004-02-11 10:07:25 UTC
Created attachment 13369 [details]
Class with external value
Comment 3 Maros Sandor 2004-02-11 16:28:22 UTC
This happens if you try to evaluate a static field of a class that 
has not been initialized. Our expression evaluator fails to find the 
class OtherClass in the debugee VM because it did not load the class 
yet. If you instantiated OtherClass at least once before you 
evaluated its static fields, everything would work fine. The solution 
to this issue is to force the debugee VM to load the offending class 
into its address space and then request the static value. I will 
prepare the fix tomorrow. It will have one minor drawback though; you 
will sometimes initialize (load) classes before they are actually 
needed by the debugee VM. But I think this will have no real impact.
Comment 4 bht 2004-02-11 17:56:50 UTC
I am impressed. Hopefully this change will also work if the other
class is an interface.
Comment 5 Maros Sandor 2004-02-18 12:20:34 UTC
I update the evaluator to handle static members better. More 
specifically, it forces the debugee VM to load a class when its 
static field needs to be evaluated. This still does not work with 
imported classes due to lack of support from the java parser. This 
will be refactored for the next release.
Comment 6 Jan Jancura 2004-06-04 14:17:41 UTC
Given usecase sometimes works (is fixed) in current trunk.
But sometimes it shows tooltip:
OtherClass.CONSTANT_CHAR = >Thread has been resumed<

Maros, can you look at it, please?
Comment 7 Jan Jancura 2004-06-08 08:32:21 UTC
Fixed in the main trunk.
>Thread has been resumed< should be covered by separate issue.
Comment 8 Quality Engineering 2010-04-29 09:16:30 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.