question: private RenewResults renewLeasesDo ( Object [ ] regIDs , Uuid [ ] leaseIDs , long [ ] renewals ) { long now = SystemTime . timeMillis ( ) ; Exception [ ] exceptions = null ; for ( int i = 0 ; i < regIDs . length ; i ++ ) { Object id = regIDs [ i ] ; try { if ( id instanceof ServiceID ) renewals [ i ] = renewServiceLeaseInt ( ( ServiceID ) id , leaseIDs [ i ] , renewals [ i ] , now ) ; else renewals [ i ] = renewEventLeaseInt ( ( Long ) id , leaseIDs [ i ] , renewals [ i ] , now ) ; } catch ( Exception e ) { renewals [ i ] = - 1 ; if ( exceptions == null ) exceptions = new Exception [ ] { e } ; else exceptions = ( Exception [ ] ) arrayAdd ( exceptions , e ) ; } } for ( int i = regIDs . length ; -- i >= 0 ; ) { if ( renewals [ i ] >= 0 ) renewals [ i ] -= now ; } return new RenewResults ( renewals , exceptions ) ; }
target:  The code that does the real work of renewLeases.  Each element of regIDs must either be a ServiceID (for a service lease) or a Long (for an event lease).  Renewals contains durations. All three arrays must be the same length.