DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Setting Up a Local Development Environment With IntelliJ, DevContainers, and Amazon Linux 2023
  • IntelliJ and Java Spring Microservices: Productivity Tips With GitHub Copilot
  • Using Unblocked to Fix a Service That Nobody Owns
  • How To Approach Dependency Management in Java [Video]

Trending

  • Intro to RAG: Foundations of Retrieval Augmented Generation, Part 2
  • Implementing API Design First in .NET for Efficient Development, Testing, and CI/CD
  • Modern Test Automation With AI (LLM) and Playwright MCP
  • Software Delivery at Scale: Centralized Jenkins Pipeline for Optimal Efficiency
  1. DZone
  2. Coding
  3. Tools
  4. Debugging: Filtering Arrays and Collections in IntelliJ IDEA

Debugging: Filtering Arrays and Collections in IntelliJ IDEA

IntelliJ IDEA 2017.2 comes with a great feature that allows you to filter arrays and collections while debugging. Take a visual tour of these new features in action.

By 
Trisha Gee user avatar
Trisha Gee
·
Jul. 27, 17 · News
Likes (9)
Comment
Save
Tweet
Share
11.4K Views

Join the DZone community and get the full member experience.

Join For Free

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.

Breakpoint during debugging

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”.

Select "filter" on a list or array

Then I can enter the criteria to filter. As you’d expect, IntelliJ IDEA offers code completion and suggestions here.

Code completion on the filter field

The debug window will now show me the subset of values in the list that match these criteria.

List filtered by start of word

If I right-click on the filter, I can edit the filter to change the original criteria or add further filters:

The filter can be changed

And I can easily remove the filter using the clear button:

Press clear to remove the filter

This feature also works on other Collection types and arrays. Here, we’ve added a watch expression that creates an array of random ints:

An int array in watches

We can filter these values, too:

A filtered list of ints

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.

intellij

Published at DZone with permission of Trisha Gee, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Setting Up a Local Development Environment With IntelliJ, DevContainers, and Amazon Linux 2023
  • IntelliJ and Java Spring Microservices: Productivity Tips With GitHub Copilot
  • Using Unblocked to Fix a Service That Nobody Owns
  • How To Approach Dependency Management in Java [Video]

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!