Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set value in Map while debugging in IntelliJ Idea

While debugging I would like to change value in HashMap (map name: params). There is: "charset" -> "ISO-8859-1". When I try to set value (F2) and type: "charset" -> "UTF-8" then error message is: Invalid expression : ->. When I try to open "charset" -> "ISO-8859-1" then there is:

key = "charset" 
value = "ISO-8859-1"

but set value (F2) on value = "ISO-8859-1" doesn't work, it's greyed out. When I open "value"="ISO-8859-1" then I see:

value={char[10]31444}
hash=20129143423

Is there a chance to change value in HashMap to set some different value instead of ISO-8859-1 which already is there.

like image 228
Michu93 Avatar asked Mar 10 '20 08:03

Michu93


People also ask

How do I change the value while debugging in Intellij?

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 .

How do I keep Debug points in Intellij?

Manage breakpoints To do this, go to Settings/Preferences | Build, Execution, Deployment | Debugger and select Drag to the editor or click with middle mouse button. Clicking a breakpoint will then enable or disable it.


Video Answer


1 Answers

Open "Evaluate" window (Alt+F8) and type a normal code to put a new value into the map:

params.put("charset", "UTF-8")
like image 128
Alex Sveshnikov Avatar answered Oct 31 '22 00:10

Alex Sveshnikov