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.
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|
Created attachment 13368 [details] Main class
Created attachment 13369 [details] Class with external value
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.
I am impressed. Hopefully this change will also work if the other class is an interface.
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.
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?
Fixed in the main trunk. >Thread has been resumed< should be covered by separate issue.
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.