I have an Eclipse project.Today I wanted to debug a main class. I put breakpoints at relevant places. Strange thing was, that executing was stopping only at breakpoints and nowhere else for some select few classes. No matter what I pressed (F6, F7, F8). Ideally F6 should take you to next line but that was not happening. I debugged other main classes and behavior was as expected (debugging was smooth F6 F7 F8 were all working fine).
For the same code base and for same main class, I tried on a colleague's laptop and debugging was smooth (as expected).
My eclipse was Luna Java version was 1.8.
Here is what all things I have tried 1) Cleaning the project and rebuilding automatically. 2) Manually cleaning all .class files. 3) Upgraded my Eclipse to Mars 2 (Installed a new Eclipse) 4) Upgraded Java from 1.8.40 to 1.8.92 5) Tried things mentioned at Eclipse - debugger doesn't stop at breakpoint
What do I do to make sure Eclipse debugging behaves as expected.
@nitind, looks like your comment has given me some pointer. There is only one class that behaves oddly. This class is an Enum implementing an interface. It has a private constructor which I am unable to debug through Eclipse. It's other methods are debugging just fine.
public enum MyEnum implements IMyInterface{
INSTANCE;
private static Log log = LogFactory.getLog(MyEnum.class);
private final Map<String, List<String>> groupMap;
private MyEnum() {
groupMap = new HashMap<String, List<String>>();
initGroupMap();
}
.....