How to change the value of a variable at a breakpoint in intelliJ

environment

Intelij Java (maybe other than Java, but unconfirmed)

procedure

If you write the code below, it will naturally be displayed as "Hello World", Suppose you want to put another value in str called "Hello World!" While debugging. スクリーンショット 2019-10-28 22.51.25.png

In such a case, set a breakpoint → Right click →More(command + shift + F8) スクリーンショット 2019-10-28 22.52.01.png

The BreakPoints window will appear Check Evaluate and log → Substitute a value for str → (If you don't want to stop at a breakpoint) Uncheck Suspend スクリーンショット 2
019-10-28 22.52.47.png

If you execute Debug in this state スクリーンショット 2019-10-28 22.53.04.png

"Hello World!" It appears twice because of the log output by Evaluate and "log".

In addition to assigning values, you can also execute methods. I think it can be used for debugging code that is executed only under special conditions.

Recommended Posts

How to change the value of a variable at a breakpoint in intelliJ
How to change the setting value of Springboot Hikari CP
How to store the information entered in textarea in a variable in the method
[chown] How to change the owner of a file or directory
I want to change the value of Attribute in Selenium of Ruby
How to increment the value of Map in one line in Java
How to change the maximum and maximum number of POST data in Spark
How to get the absolute path of a directory running in Java
Android development, how to check null in the value of JSON object
How to get the ID of a user authenticated with Firebase in Swift
[Swift] How to change the order of Bar Items in Tab Bar Controller [Beginner]
How to convert a value of a different type and assign it to another variable
How to make a unique combination of data in the rails intermediate table
How to create a Spring Boot project in IntelliJ
[Rails] How to change the column name of the table
How to find the total value, average value, etc. of a two-dimensional array (multidimensional array)-java
[ruby] How to assign a value to a hash by referring to the value and key of another hash
Sample code to assign a value in a property file to a field of the expected type
How to change application.properties settings at boot time in Spring boot
Determine that the value is a multiple of 〇 in Ruby
How to change a string in an array to a number in Ruby
How to create a placeholder part to use in the IN clause
How to retrieve the hash value in an array in Ruby
[Ruby] How to retrieve the contents of a double hash
How to add the same Indexes in a nested array
Mapping to a class with a value object in How to MyBatis
How to derive the last day of the month in Java
How to change the contents of the jar file without decompressing
How to change BackgroundColor etc. of NavigationBar in Swift UI
[jsoup] How to get the full amount of a document
When I switched to IntelliJ, I got a lot of differences in the encoding of the properties file.
How to specify an array in the return value / argument of the method in the CORBA IDL file
Considering the adoption of Java language in the Reiwa era ~ How to choose a safe SDK
[Swift] How to dynamically change the height of the toolbar on the keyboard
A solution to the problem of blank spaces at the beginning of textarea
How to display 0 on the left side of the standard input value
How to create a new Gradle + Java + Jar project in Intellij 2016.03
How to output the value when there is an array in the array
[Rails] How to change the page title of the browser for each page
How to get the id of PRIMAY KEY auto_incremented in MyBatis
How to output a list of strings in JSF as comma-separated strings
How to check for the contents of a java fixed-length string
How to call multiple names at once in the same category
How to get the length of an audio file in java
[Java] How to search for a value in an array (or list) with the contains method
How to change app name in rails
The secret to the success of IntelliJ IDEA
How to insert a video in Rails
How to determine the number of parallels
How to change the timezone on Ubuntu
Ransack sort_link How to change the color!
Notation to put a variable in a string
How to sort the List of SelectItem
How to pass the value to another screen
How to get the date in java
How to publish a library in jCenter
How to output the sum of any three numbers, excluding the same value
I tried to make a parent class of a value object in Ruby
How to return a value from Model to Controller using the [Swift5] protocol
The story of forgetting to close a file in Java and failing
Procedure to make the value of the property file visible in Spring Boot