IntelliJ Type Renderers

| | Comments (1) | TrackBacks (0)

When debugging in IntelliJ you may need to inspect byte arrays as these byte arrays may contain meaningful text. Out of the box individual byte array values will be rendered as numeric byte values. This makes it difficult to decipher what it is you're debugging.

pre_renderer.gif

Fortunately IntelliJ gives a way to customize your data views when debugging. The way to handle this is create a custom Type Renderer. While inspecting values during a debug session, in the Frame tab right click and select "Customize Data Views...". A dialog will appear, select the Type Renderers tab. IntelliJ allows you to create a renderer for objects of a particular type. Apply renderer to a byte[] and use the expression "new String(this)".

customize_data_views.gif


This will render the byte array as a String:

post_renderer.gif

For cases when you don't want this type renderer enabled, IntelliJ allows you to disable the renderer by unchecking the checkbox next to the renderer name.




1 Comment

Mark Pritchard said:

Found this via Google, was wondering how to do exactly this.

Thanks!

Leave a comment

0 TrackBacks

Listed below are links to blogs that reference this entry: IntelliJ Type Renderers.

TrackBack URL for this entry: http://www.nearinfinity.com/mt/mt-tb.cgi/448