From the course: Java's Toughest Bugs
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Debugging steps - Java Tutorial
From the course: Java's Toughest Bugs
Debugging steps
- [Instructor] Let's add a few breakpoints where we think the issue might be occurring. It could be that we're not setting the transaction fee correctly, so let's add a breakpoint there. We'll also add a breakpoint where we process the payment, so we can check if we're processing the payment with the correct transaction fee value. Let's run it in debug mode. We've stopped just before the set transaction fee execution. Let's step into it. The transaction fee default is 0, and that's what we see here. Let's set it to 2.5. We'll click step over. Great, it works as expected. The transaction fee is now 2.5. We can even double check our work by using the debug console. We'll run creditCardPayment.getTransactionFee to ensure it's set to 2.5. And it is. Now let's set the PayPal transaction fee. We'll click step into. When we go to the setter, the fee is already 2.5. That's strange, because in theory, it should be…