I have the following piece of code:
Matcher matchDays = m_daysRegex.matcher(e.getKey());
if (matchDays.matches()){
...
}
Where e.getKey()
is "Mon-Fri".
Now, I have already executed the first line and stand on the if expression. Using the watch window I evaluate the matchDays.matches()
expression and then add some watches on the various methods of matchDays
. Then using the same watch window I evaluate the matchDays = m_daysRegex.matcher("Mon,Fri")
and matchDays.matches()
expressions to see what happens. Unfortunately, the watch window does not refresh itself and it does not have an explicit button to do so:
On the image above, notice how matchDays.group(0)
displays "Mon,Fri", but matchDays.group(1)
displays "Mon-Fri". This is because I manually refreshed the former, but all the rest still show the old values. I have to manually refresh them all, which is annoying.
Am I doing something wrong? Is there the right way to do it, so the watch expressions are refreshed automatically? Or is there a way to refresh the whole watch window?
Thanks.
Select a variable or a property of a complex object in the Debug window, press F2 or right-click and choose Set Value... from the context menu, and then specify a new value and press Enter .
You can change a variable in the Evaluate dialog or in the Watch List panel. The Evaluate dialog: To invoke the dialog, press the Call the Evaluate Dialog button on the Debug toolbar, or press the Ctrl+F12 shortcut (this is the default shortcut. You can change it any time.
Use breakpoint expressions In order to change the flow of your program, you can use non-suspending breakpoints that evaluate an expression when hit. This is useful, for example, when you want to automatically modify your variables during debugging.
To change the value of a variable in runtime in IntelliJ:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With