Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 120634

Summary: [variables] Toggle "Show static variables" causes expansion to be lost
Product: [Eclipse Project] Platform Reporter: Samantha Chan <chanskw>
Component: DebugAssignee: Platform-Debug-Inbox <platform-debug-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: darin.eclipse
Version: 3.2   
Target Milestone: 3.3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Potential hack none

Description Samantha Chan CLA 2005-12-13 12:19:28 EST
1.  Stop at the line of ArrayList initialization
2.  Expand the variable list->elementData
3.  Toggle "Show static variables" on

Variable "list" is collapsed.

4.  Toggle "Show static variables" off

Variables "list" is expanded again.  The variables should stay expanded during the toggle.

Testcase:

import java.util.ArrayList;

public class TestStaticVariables {

	static public String hello;
	static public TestStaticVariables me;
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		me = new TestStaticVariables();
		String str = "abc";
		ArrayList list = new ArrayList();
		list.add("abc");
	}

}
Comment 1 Darin Wright CLA 2006-04-04 17:43:45 EDT
Also see bug 126379 
Comment 2 Kevin Barnes CLA 2006-04-06 11:14:03 EDT
Created attachment 37887 [details]
Potential hack

This is a potential solution that would maintain expansion and selection in the variables view. It's a hack though because it involves a few illegal references.

Not sure what a good solution would be. The ViewFilter actions ultimately just call refresh(). refresh() should probably maintain selection and expansion by default.
Comment 3 Kevin Barnes CLA 2006-04-07 14:48:30 EDT
This mostly working as expected now. There are still some issues with the way we save/restore state. It uses indexes instead of referencing the model. Therefore if item 2 in the list was expanded, and a new static item was added, the second item in the tree would still be expanded even if it does not contain the same data.

Not sure how to fix this within our current save/restore story.
Comment 4 Kevin Barnes CLA 2006-04-17 10:46:10 EDT
post 3.2
Comment 5 Darin Wright CLA 2007-06-08 14:22:56 EDT
Fixed in 3.3
Comment 6 Darin Wright CLA 2007-06-08 14:23:18 EDT
Fixed.
Comment 7 Darin Wright CLA 2007-06-08 14:23:28 EDT
Verified.