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 118785 - [60cat] Debuger not works with public static variables (Unknown type)
Summary: [60cat] Debuger not works with public static variables (Unknown type)
Status: REOPENED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: PC Windows 7 x64
: P3 blocker with 1 vote (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks: 108873
  Show dependency tree
 
Reported: 2007-10-13 06:31 UTC by _ theanuradha
Modified: 2015-09-18 06:56 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Project (9.58 KB, application/octet-stream)
2007-10-13 06:32 UTC, _ theanuradha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ theanuradha 2007-10-13 06:31:54 UTC
[ JDK VERSION : 1.6.0_02 ]

Debugger not works with public static  varibals 
(Unknown type)
Steps 
1 : Open attached project

2 : add a brake point to line 19( String test =
main.returnString(ENUMS.STRING);) 

3 :debug project

4 :when debugger hit brake point move cursor to "ENUMS.STRING" it
says "Unknown type"

5 :even add watch  to main.returnString(ENUMS.STRING)
sys "Unknown type"

Only possible workaround is add watch as 

main.returnString("STRING")

but it is really painful if you have lots of Static Enums(Not enum
type)
Comment 1 _ theanuradha 2007-10-13 06:32:41 UTC
Created attachment 50884 [details]
Project
Comment 2 Martin Entlicher 2007-10-13 17:20:33 UTC
Reproduced, thanks for the test project. It's strange, that Integer.MAX_VALUE is evaluated without problems. This is not
a regression, NetBeans 5.5.1 suffers from the same problem.

This is just another problem in NetBeans evaluator. A complete rewrite is really necessary, see issue #108873.
Unfortunately this is a complex task, which can not be done into NB 6.0.
Comment 3 _ theanuradha 2007-10-15 05:33:09 UTC
Any possibility of  workaround fix(Patch)?
Comment 4 Martin Entlicher 2007-12-13 17:17:55 UTC
Fixed in the new evaluator algorithm - see issue #108873.
Comment 5 Quality Engineering 2010-04-29 09:36:09 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.
Comment 6 1ac0 2015-09-17 13:06:39 UTC
It looks like in NB 8.0.2 the bug is back.

Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 1
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14
System: Windows 7 version 6.1 running on amd64; UTF-8; en_US (nb)
User directory: C:\Users\user_hidden\AppData\Roaming\NetBeans\8.0.2
Cache directory: C:\Users\user_hidden\AppData\Local\NetBeans\Cache\8.0.2



public class TestClassTwo {
	public static final int VARIABLE = 1;
}


public class TestClassOne {
	public static void main(String[] args) {
		System.out.println("value is: " + TestClassTwo.VARIABLE);
	}
}

When breakpoint is set in TestClassOne on line with println(String), debugger shows 'Unknown type "TestClassTwo"'.
Comment 7 Martin Entlicher 2015-09-18 06:56:51 UTC
Reproduced. The problem is, that TestClassTwo class was not loaded into the VM. The compiled code has hard-coded the final static value. I do not think debugger is able to show the value without loading the TestClassTwo class. Issue #168949 is preventing us from loading the class.