troubleshooting Question

Conditional breakpoint in Eclipse

Avatar of allelopath
allelopath asked on
JavaEditors IDEs
2 Comments1 Solution677 ViewsLast Modified:
Following the example here:
http://thecoderlounge.blogspot.com/2010/06/print-points-debugging-by-writing-to.html
I am inserting a printpoint In the SDK code at Container.addImpl():
System.out.println ("Container.addImpl(): " + component + "\tindex: " + index);
return false;

The printpoint is on the 2nd line of code:
        if (index > component.size() || (index < 0 && index != -1)) {

The problem is that it gives me an error saying that comp and index cannot be resolved
If I do this:
System.out.println ("Container.addImpl(): " + component);
It compiles with no error (component is a class member of Container)

So it has access to the class component but not the parameters.
One might think that the compiler has removed these, but it appears to be in debug mode by virtue of having by default the following boxes In Project -> properties -> Java Compiler checked:
x Add variable attributes to generated class files (used by the debugger)
x Add line number attributes to generated class files (used by the debugger)
x Add source file name to generated class file (used by the debugger)
x Preserve unused (never read) local variables

I also tried this:
System.out.println ("Container.addImpl(): " + args[0] + "\tindex " + args[1]);
return false;
but this gives similar compile errors for args

What can be done to do make comp and index visible?



ASKER CERTIFIED SOLUTION
sanjooz

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros