conditional breakpoints in eclipse

ever debugged through code that processed items of a huge collection?
but you are only interested in the processing of one specific collection?

never mind – there are good news!
Eclipse offers the chance to define conditional breakpoints, that is to specify a condition under which the breakpoint will suspend, if and only if that condition will become true (or alternatively, everytime the condition changes).

what to do

switch to the ‘debug’ perspective and open the view ‘breakpoints’

open the contextmenu of the breakpoint you want to make conditional and select ‘Breakpoint Properties…’

activate the checkbox ‘Enable Condition’.
now you are allowed to type the condition under which circumstances the breakpoint should suspend. you are free to express an arbitrary java expression (in the above mentioned case a boolean expression).
you can refer to any object, which is visible to the point in your source the pointcut is set (ctrl + space will list all referencable objects).
for example, the condition could refer to a property of the longing item of the collection which has an unique value
(like currentItem.getNamedId().equals( “1234567” ) ).

be sure, that the option ‘Suspend when: condition is true’ is activated

suspend policy should be set to ‘Suspend Thread’

That’s it!
The next time you debug through that piece of code, the breakpoint will only suspend, if the specified condition becomes true.


6 Responses to “conditional breakpoints in eclipse”

  1. seiko lk Says:

    セイコー タイ

    • Debra Says:

      This is just the percfet answer for all of us

    • find the price of a car Says:

      hvor sjovt! har faktisk netop lige en lille kande hvid tempel te, der står og trækker imens jeg læser dette den er så god!

    • Says:

      It’s unfortunate that it wasn’t included; everybody should have a tentacle stand. .The bunnysuit stuff is sorta odd; I guess someone there really has a fetish for that sort of outfit, and I guess they must sell well for them. I thought about getting Ikaros but I’m going to pass on that figure; I’m not a big fan of bunnysuits to start with and I’ve probably already ordered too much stuff scheduled for July and August releases, anyway.

    • cheap car insurence Brewster Says:

      valla bnim babamı da orta okulda kandırmışlar istiyo ama bırakamıyodu bi gün hepimizi söz verdi son bi tane içti ve şimdi 1.5 yıl oldu bi daha da içmedi insanın önce kendisi istemeli dimi ama

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: