Community
Participate
Working Groups
Stepping through org.eclipse.swt.layout.GridLayout.calculateGridDimensions(...), I found that the variables it declared in the first statement as: int maxWidth, childWidth, maxHeight, childHeight; would appear and disappear in the variables view as I stepped through the code They did not appear until first assigned. childWidth disappeared when I exited the nested for loop for row. maxWidth disappeared when I exited the for loop for column. I would expect them to always be visible after the first statement, or at least after they're first assigned, until the method returns. NOTES: NE (08/29/01 6:04:59 PM) Screen shot in Q:\viper\team\Nick\PRs\1GJ8PX4.zip DW (9/7/01 8:56:26 AM) I think this is due to the way the byte codes are generated. The variables are allocated inside the loops, even though they are declared outside the loops. Waiting for clarification from PM.
PRODUCT VERSION: 133
Local variables appear in the debugger only when they are definitely assigned. In this example, maxWidth is definitely assigned in the for loop, but it is not as soon as it exited the for loop. The reason is that the for loop might not have been executed before you reach the if statement. Then the variable is not definitely assigned and there is no reason according to the specs to diplay it. In order to know when a local variable should be displayed or not, you should try to use it without initializing it in the source code and if you get an error saying that this variable might not have been initialized, then this variable should not be displayed at this position in the debugger. Suggest to close.
Thanks for the clarification.