Java Inspector ignores static imports [message #839915] |
Mon, 09 April 2012 12:07 |
Thomas Guckenbiehl Messages: 3 Registered: April 2012 |
Junior Member |
|
|
Hi,
I have a problem with debugging Java code with Eclipse Indigo 3.7 SR2. For demonstration purposes consider the following simple program:
package eu.guckenbiehl.test;
import eu.guckenbiehl.utils.MyConstants;
public class MyTest {
public static void main(String[] args) {
System.out.println(MyConstants.SOME_CONSTANT); // <-- Breakpoint here
System.out.println("Done.");
}
}
If I debug this program, I can stop at a breakpoint on the first line of main(). But if I then mark "MyConstants.SOME_CONSTANT" and try to evaluate it using the "Display" command in the context menu, I get the error "MyConstants cannot be resolved to a variable". The same happens if I use the Inspect command from the context menu.
However, if I go on with debugging and step over that line, the value of MyConstants.SOME_CONSTANT is printed to the console without any errors. Hence, the classpath of the debugger seems to be alright. Also, if I explicitly specify the package of MyConstants writing
System.out.println(eu.guckenbiehl.utils.MyConstants.SOME_CONSTANT);
the Display and Inspect commands work fine.
This happens whenever I try to apply Display and Inspect to expressions that refer to static variables or functions. If the expression refers only to variables or functions of instances, then Display and Inspect work as I expect. I also seem to remember, that in Eclipse 3.4 it was possible to display/inspect static expressions.
So, what am I missing? Do I have to set some particular option?
Thanks for any help,
Thomas
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03607 seconds