Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
for (Transaction commit : SPIAccessor.DEFAULT.getCommits(bag)) {
	SPIAccessor.DEFAULT.check(commit, true);
}

Could Is perfectly readable and performant, but it could be transformed to the Streaming API equivalent:

...

But the resulting code will be slower and more difficult to debug, so it the change does not really add more value to the source code.

When using the Streaming API always try to be write readable constructs and make the code easy to debug (by splitting complex streaming API constructs in multiple lines, for instance).

Keep explicity typing

Try not to remove typing when using generics with the diamond operator. So, for instance, you could replace

...