Debugger: Filtering Arrays & Collections in IntelliJ IDEA 2017.2
As usual, the newest version of IntelliJ IDEA contains updates to help you debug applications. Given that we are working more and more with large data sets, IntelliJ IDEA 2017.2 has added the ability to filter arrays and collections in our variables or watches.
In this example, I have a variable
allWords that’s a list of Strings. This is a large list, so when I’m debugging my application I may want to look for specific values, or types of values, in this list. I can do this by right-clicking on the list and selecting “filter”.
Then I can enter the criteria to filter. As you’d expect, IntelliJ IDEA offers code completion and suggestions here.
The debug window will now show me the subset of values in the list that match this criteria.
If I right click on the filter, I can edit the filter to change the original criteria or add further filters
And I can easily remove the filter using the clear button.
This feature also works on other Collection types, and arrays. Here, we’ve added a watch expression that creates an array of random ints
We can filter these values too
This ability to filter the values in large collections like lists and arrays make it easier for us, as we’re debugging an application, to see which values are available, and particularly if one or more of them match some criteria we’re looking for.
Subscribe to Blog updates
Build a Spring Boot App with AI Assistant
In this article, we’ll be building a small Java Spring Boot web application in IntelliJ IDEA with the help of JetBrains AI Assistant. If you’d like to follow along with this tutorial, you’ll need IntelliJ IDEA Ultimate, as well as an active subscription to AI Assistant or the free seven-day trial…
Top 10 UI Updates in IntelliJ IDEA for 2023
Hey there, fellow developers! Today, we want to share the most significant UI updates from 2023 that have transformed how IntelliJ IDEA looks and functions. New UI Of course, the highlight of our recent updates was the launch of our new, clean, and modern UI. This was first announced at the en…
The What, Why, and How of JPA Buddy in IntelliJ IDEA
Master JPA entity management with JPA Buddy in IntelliJ IDEA! Our latest article shows you how to simplify your workflow and reduce boilerplate code.
The Best of IntelliJ IDEA’s HTTP Client
In today's fast-paced tech world, easy and efficient management of web services and APIs is crucial. That's where IntelliJ IDEA's HTTP Client steps in, turning complex HTTP requests into a walk in the park. The HTTP Client is a feature-rich, text-based tool in IntelliJ IDEA Ultimate. It seamlessl…