final Node < K , V > advance ( ) { Node < K , V > e ; if ( ( e = next ) != null ) e = e . next ; for ( ; ; ) { Node < K , V > [ ] t ; int i , n ; // must use locals in checks if ( e != null ) return next = e ; if ( baseIndex >= baseLimit || ( t = tab ) == null || ( n = t . length ) <= ( i = index ) || i < 0 ) return next = null ; if ( ( e = tabAt ( t , i ) ) != null && e . hash < 0 ) { if ( e instanceof ForwardingNode ) { tab = ( ( ForwardingNode < K , V > ) e ) . nextTable ; e = null ; pushState ( t , i , n ) ; continue ; } else if ( e instanceof TreeBin ) e = ( ( TreeBin < K , V > ) e ) . first ; else e = null ; } if ( stack != null ) recoverState ( n ) ; else if ( ( index = i + baseSize ) >= n ) index = ++ baseIndex ; // visit upper slots if present } }
Advances if possible returning next valid node or null if none .