]> source.dussan.org Git - jgit.git/commit
Simplify RevWalk#iterator by factoring out common code 61/132161/2
authorJonathan Nieder <jrn@google.com>
Fri, 9 Nov 2018 02:11:57 +0000 (18:11 -0800)
committerJonathan Nieder <jrn@google.com>
Fri, 9 Nov 2018 02:19:01 +0000 (18:19 -0800)
commita0cd400c37bb861264fa2147f94123c6f0e19b7c
treed9746e37221737b14dd9d367d5122d566c429e12
parentaeba0032003480dd821edc22fa4ab1a66192549f
Simplify RevWalk#iterator by factoring out common code

Factor out a helper that calls next() and tunnels IOException in a
RuntimeException, similar to TunnelException.tunnel(RevWalk::next) in
Guava terms[1].

This should make the code a little more readable.  No functional
change intended.

[1] https://github.com/google/guava/issues/2828#issuecomment-304187823

Change-Id: I97c062d03a17663d5c40895fd3d2c6a7306d4f39
Signed-off-by: Jonathan Nieder <jrn@google.com>
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java