Eclipse Conditional Debugging

I am wondering if there is a way to add a conditional breakpoint in eclipse during debugging. Example: if the city == "New York", then it will break.

+4
source share
3 answers

Yes. Right-click the breakpoint, select Breakpoint Properties, enable Conditional, and then enter the condition. Note that city == "New York" will not be a good condition because of how equality works in Java, but "New York".equals(city) will be fine. Note that Eclipse allows for simple Boolean conditions like this, as well as "pause when the value changes."

+7
source

Open the context menu above the breakpoint in the left pane of the code editor, select "Breakppoint Properties ..." and "Enable Condition"

+2
source

All Articles