How to use conditional breakpoint in Eclipse?

MozenRath picture MozenRath · Aug 25, 2011 · Viewed 109.8k times · Source

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

ZenMaster picture ZenMaster · Aug 25, 2011

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