private boolean recovery(OBlock block){
  if (_occupies.size() == 0) {
    Iterator<OBlock> it=_headRange.iterator();
    while (it.hasNext()) {
      OBlock b=it.next();
      if ((b.getState() & (OBlock.DARK | OBlock.OCCUPIED)) != 0) {
        _lostRange.add(b);
        if (log.isDebugEnabled()) {
          log.debug("  _lostRange.add " + b.getDisplayName() + " value= "+ b.getValue());
        }
      }
    }
    it=_tailRange.iterator();
    while (it.hasNext()) {
      OBlock b=it.next();
      if ((b.getState() & (OBlock.DARK | OBlock.OCCUPIED)) != 0) {
        _lostRange.add(b);
        if (log.isDebugEnabled()) {
          log.debug("  _lostRange.add " + b.getDisplayName() + " value= "+ b.getValue());
        }
      }
    }
  }
  if (log.isDebugEnabled()) {
    log.debug("recovery( " + block.getDisplayName() + ") + _lostRange.size()= "+ _lostRange.size());
  }
  if (_lostRange == null || _lostRange.size() == 0) {
    return false;
  }
  OBlock blk=(OBlock)JOptionPane.showInputDialog(null,Bundle.getMessage("TrackerNoCurrentBlock",_trainName,block.getDisplayName()) + "\n" + Bundle.getMessage("PossibleLocation"),Bundle.getMessage("WarningTitle"),JOptionPane.INFORMATION_MESSAGE,null,_lostRange.toArray(),null);
  if (blk != null) {
    _occupies.addFirst(blk);
    showBlockValue(blk);
  }
 else {
    return false;
  }
  setupCheck();
  return true;
}

private boolean recovery ( OBlock block ) { if ( _occupies . size ( ) == 0 ) { Iterator < OBlock > it = _headRange . iterator ( ) ; while ( it . hasNext ( ) ) { OBlock b = it . next ( ) ; if ( ( b . getState ( ) & ( OBlock . DARK | OBlock . OCCUPIED ) ) != 0 ) { _lostRange . add ( b ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "  _lostRange.add " + b . getDisplayName ( ) + " value= " + b . getValue ( ) ) ; } } } it = _tailRange . iterator ( ) ; while ( it . hasNext ( ) ) { OBlock b = it . next ( ) ; if ( ( b . getState ( ) & ( OBlock . DARK | OBlock . OCCUPIED ) ) != 0 ) { _lostRange . add ( b ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "  _lostRange.add " + b . getDisplayName ( ) + " value= " + b . getValue ( ) ) ; } } } } if ( log . isDebugEnabled ( ) ) { log . debug ( "recovery( " + block . getDisplayName ( ) + ") + _lostRange.size()= " + _lostRange . size ( ) ) ; } if ( _lostRange == null || _lostRange . size ( ) == 0 ) { return false ; } OBlock blk = ( OBlock ) JOptionPane . showInputDialog ( null , Bundle . getMessage ( "TrackerNoCurrentBlock" , _trainName , block . getDisplayName ( ) ) + "\n" + Bundle . getMessage ( "PossibleLocation" ) , Bundle . getMessage ( "WarningTitle" ) , JOptionPane . INFORMATION_MESSAGE , null , _lostRange . toArray ( ) , null ) ; if ( blk != null ) { _occupies . addFirst ( blk ) ; showBlockValue ( blk ) ; } else { return false ; } setupCheck ( ) ; return true ; }
called when _occupies is empty
