Java Stream Debugger

Compatible with: IntelliJ IDEA MPS Android Studio
Jan 10, 2018
39 128

In some ways, Stream API is better than traditional loop approach: it takes full advantage of modern multi-core architectures, and lets you process data in a declarative way. What's also good is that this approach helps to avoid the state issues, and the code written in it looks more elegant. But, there's a certain downside to it: the code sometimes is sure hard to read, understand, and, of course, to debug.

This plugin is here to amend that and offer solutions to the issues you might run into. It extends the Debugger tool window by adding the Trace Current Stream Chain button, which becomes active when debugger stops inside of a chain of Stream API calls.

After you click it, the current data stream is evaluated and you get a visualization of what exactly happens to each element from the first call to last, with changes occurring gradually as it's passing thru all the steps:

The Split Mode button in the left bottom corner lets you choose whether you want to see all operations at once or separately:

In the latter mode, you can switch between operations manually using the tabs on top.

The plugin is still under development, so expect a couple of glitches here and there, and, of course, we really appreciate your feedback, including error reports, and we have set up an issue tracker just for that.

Warning: debugging of java stream chains in the Android Studio IDE is disabled. Use the Kotlin Sequence Debugger to debug kotlin sequence chains.

Recent change notes

  • Add extension point to support new libraries/languages
  • Support Android Studio 3.0.* (only for Kotlin Sequence Debugger plugin)
  • Bug-fixes and minor improvements
  • Update UI
  • Bug-fixes and improvements
  • Support StreamEx library
  • Minor fixes and improvements
  • Remove usage of unsupported API
  • Add transitions for toArray/collect/find*/*Match terminal methods
  • Support stream with nulls
  • Fix bug when IDE hangs
  • Minor fixes and improvements

General usage instructions

Watch the following short animation to see the features in action: