Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I debug after certain processing is done-Java

I need to debug my java code but only after certain processing is done and I reach a point where it faults down.

For Eg:-I am preprocessing my code and I have created a filter which would refrain from inserting into database if its size is less then 5.And I name the group which is inserted as 1,2....My problem is the number 121 has a size of 4 and its getting inserted into the database.So how should i debug so that I can start directly at 121 ignoring all the previous sequence number.I am using Eclipse IDE.

like image 352
log N Avatar asked Dec 05 '25 10:12

log N


2 Answers

You can use conditional break points as following:

  1. Put the break point at specific line.
  2. Right click on break point.
  3. Select "Breakpoint Properties".
  4. In it select "Enable Condition". In it you can set condition for break point for your variable having value of 121. Ctrl + Space will also work in the box for code assist.
like image 129
Harry Joy Avatar answered Dec 07 '25 00:12

Harry Joy


If the number is fixed always, you can put a temporary check condition for example

if(number == 121) {
    continue;
}

And put a break point at continue.

like image 44
Gurpreet Sachdeva Avatar answered Dec 06 '25 23:12

Gurpreet Sachdeva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!