0

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();
    }


.....
Community
  • 1
  • 1
Anil
  • 1,735
  • 2
  • 20
  • 28
  • Go to run configuration for your main class and see the source that is showing up in the configuration. It might be the case that some other version of code is attached to the latest class files. – Vishal May 17 '16 at 17:25
  • Which classes are behaving oddly (keeping in mind that F6 isn't next line)? What's different about them on the two systems? – nitind May 17 '16 at 18:29
  • @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. I have added the class code above in question. I would write a similar class and try to debug in Eclipse – Anil May 18 '16 at 19:43

0 Answers0