How to set a breakpoint on a default Java constructor in Eclipse? - Stack Overflow
Solution 1: member initializers
If you have any member variables with initializers, then you can put a breakpoint on them. For example:
class MyClass { private int i = 0; // this line can have a breakpoint in Eclipse }
Solution 2: class load breakpoints
If you can get by with only hitting this breakpoint once, then you can use a class load breakpoint:
You can set a Class Load Breakpoint, which will stop when the class is being lodaed [sic]. Right-click on a class in the Package Explorer, Project Explorer, or Types view and choose "Toggle class load breakpoint"
As the name implies, this breakpoint will be hit when the class is first loaded, so it will only fire once (assuming you only have a single classloader). But depending on your needs, it might be good enough.
Read full article from How to set a breakpoint on a default Java constructor in Eclipse? - Stack Overflow
No comments:
Post a Comment