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);
}

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 ) ; }
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 .
