How to use conditional breakpoint in Eclipse?

Tags: , , ,



I want to know how to place a conditional breakpoint in Eclipse. I have a code like:

public static void doForAllTabs(String[] tablist){
    for(int i = 0; i<tablist.length;i++){
-->        doIt(tablist[i]);
    }
}

Now I want to put a breakpoint on the line with the arrow but want it to trigger only if:

tablist[i].equalsIgnoreCase("LEADDELEGATES");

Answer

Put your breakpoint. Right-click the breakpoint image on the margin and choose Breakpoint Properties:

enter image description here

Configure condition as you see fit:

enter image description here



Source: stackoverflow