restore the last block hierarchy variable map from archive to working.

@return true if restored successfully else false
5510
public boolean restoreLastMapFromArchive() {
		boolean success = false;
		List<Map<Object, Object>> object = null;
		if (oldBlockHierarchy.size() > 0) {
			object = oldBlockHierarchy.remove(oldBlockHierarchy.size() - 1);
			if (object != null) {
				working = object;
				success = true;
			}
		}
		return success;
	}
169259
private boolean methodBasedRecoverLease(String src, boolean discardLastBlock)
    throws IOException {
    // check if closeRecoverLease(discardLastBlock) is supported
    if (namenodeProtocolProxy.isMethodSupported(
        "closeRecoverLease", String.class, String.class, boolean.class)) {
      try {
        return namenode.closeRecoverLease(src, clientName, discardLastBlock);
      } catch (RemoteException re) {
        throw re.unwrapRemoteException(FileNotFoundException.class,
                                       AccessControlException.class);
      }
    }
    // check if closeRecoverLease is supported
    else if (namenodeProtocolProxy.isMethodSupported(
        "closeRecoverLease", String.class, String.class)) {
      try {
        return namenode.closeRecoverLease(src, clientName);
      } catch (RemoteException re) {
        throw re.unwrapRemoteException(FileNotFoundException.class,
                                       AccessControlException.class);
      }
    }
    // check if recoverLease is supported
    if (namenodeProtocolProxy.isMethodSupported(
        "recoverLease", String.class, String.class)) {
      try {
        namenode.recoverLease(src, clientName);
      } catch (RemoteException re) {
        throw re.unwrapRemoteException(FileNotFoundException.class,
                                       AccessControlException.class);
      }
      return !namenode.getBlockLocations(src, 0, Long.MAX_VALUE).isUnderConstruction();
    }
    // now use append
    OutputStream out;
    try {
      out = append(src, conf.getInt("io.file.buffer.size", 4096), null);
    } catch (RemoteException re) {
      IOException e = re.unwrapRemoteException(AlreadyBeingCreatedException.class);
      if (e instanceof AlreadyBeingCreatedException) {
        return false;
      }
      throw re;
    }
    out.close();
    return true;
  }
99674
public function restore()
    {
        if (class_exists($class = $this->owner_type)) {
            $model = $this->$class->findOrFail($this->owner_id);
            $model->fill($this->old_value);

            return $model->save();
        }

        return false;
    }
1133433
private boolean lostPartitionDetected() {
        int currentLostPartitionCount = lostPartitionCounter.get();
        if (currentLostPartitionCount == lastKnownLostPartitionCount) {
            return false;
        }

        lastKnownLostPartitionCount = currentLostPartitionCount;
        return true;
    }
1149558
SaveRestoreState saveRestoreState() {
    List<Statement> saves = new ArrayList<>();
    List<Statement> restores = new ArrayList<>();
    // Iterate backwards so that we restore variables in order of definition which will ensure that
    // derived fields work correctly.
    for (Iterator<Map<VarKey, Variable>> iterator = frames.descendingIterator();
        iterator.hasNext();
        ) {
      Map<VarKey, Variable> frame = iterator.next();
      for (Variable var : frame.values()) {
        saves.add(var.save());
        restores.add(var.restore());
      }
    }
    return new AutoValue_TemplateVariableManager_SaveRestoreState(
        Statement.concat(saves), Statement.concat(restores));
  }
910149
private boolean setupPipelineForAppend(LocatedBlock lastBlock) throws IOException {
    if (nodes == null || nodes.length == 0) {
      String msg = "Could not get block locations. " +
          "Source file \"" + src
          + "\" - Aborting...";
      DFSClient.LOG.warn(msg);
      setLastException(new IOException(msg));
      closed = true;
      if (streamer != null) streamer.close();
      return false;
    }
    
    boolean success = createBlockOutputStream(nodes, dfsClient.clientName, false, true);
    long oldGenerationStamp = 
        ((LocatedBlockWithOldGS)lastBlock).getOldGenerationStamp();
    
    if (success) {
      // bump up the generation stamp in NN.
      Block newBlock = lastBlock.getBlock();
      Block oldBlock = new Block(newBlock.getBlockId(), newBlock.getNumBytes(), 
          oldGenerationStamp);
      dfsClient.namenode.updatePipeline(dfsClient.clientName, 
          oldBlock, newBlock, nodes);
    } else {
      DFSClient.LOG.warn("Fall back to block recovery process when trying" +
          " to setup the append pipeline for file " + src);
      // set the old generation stamp 
      block.setGenerationStamp(oldGenerationStamp);
      // fall back the block recovery
      while(processDatanodeError(true, true)) {
        try {
          Thread.sleep(1000);
        } catch (InterruptedException  e) {
          lastException = new IOException(e);
          break;
        }
      }
    }
    return success;
  }
628673
public Command undoLast() {
        Command lastCommand = undoStack.pop();
        redoStack.push(lastCommand);
        lastCommand.undo();
        return lastCommand;
    }
623055
private synchronized boolean expungeStaleEntries()
    {
        if (this.size == 0) return false;
        Object r;
        boolean result = false;
        while ( (r = queue.poll()) != null)
        {
            result = true;
            SingleEntry e = (SingleEntry)r;
            this.size -= e.cleanupPkTable(this.table);
            this.nonDatedEntryCount -= e.cleanupSemiUniqueTable(this.nonDatedTable);
        }
        return result;
    }
118182
public boolean getAutoRemoved(){
        Map<String, String> meta = getMetadata();
        if (meta!=null&&meta.containsKey("autoRemoved")){
            return !"false".equals(meta.get("autoRemoved"));
        }
        return true;
    }
1204502
public function restore()
    {
        $result = false;
        if ($this->backedUpFname !== null && is_dir($this->backedUpFname)) {
            $newPath = DIR_PACKAGES . '/' . $this->getPackageHandle();
            if (!is_dir($newPath)) {
                if (@rename($this->backedUpFname, $newPath)) {
                    $result = true;
                }
            }
        }

        return $result;
    }
1326440
public boolean needsRefreshing() {
		// is there a new version available?
		long lastmodified = new File(pathResourceDirectory,
				Parameters.lexiconName).lastModified();
		boolean needsRefreshing = false;
		if (lastmodifiedLexicon != lastmodified) {
			needsRefreshing = true;
		}
		return needsRefreshing;
	}
567970
void restoreFromSnapshot() throws IOException {
    Zxid snapshotZxid = persistence.getSnapshotZxid();
    LOG.debug("The last applied zxid in snapshot is {}", snapshotZxid);
    if (snapshotZxid != Zxid.ZXID_NOT_EXIST &&
        lastDeliveredZxid == Zxid.ZXID_NOT_EXIST) {
      // Restores from snapshot only if the lastDeliveredZxid == ZXID_NOT_EXIST,
      // which means it's the application's first time recovery.
      File snapshot = persistence.getSnapshotFile();
      try (FileInputStream fin = new FileInputStream(snapshot)) {
        LOG.debug("Restoring application's state from snapshot {}", snapshot);
        stateMachine.restore(fin);
        lastDeliveredZxid = snapshotZxid;
      }
    }
  }
1060832
public boolean hasBlockMeta(long blockId) {
    for (StorageTier tier : mTiers) {
      for (StorageDir dir : tier.getStorageDirs()) {
        if (dir.hasBlockMeta(blockId)) {
          return true;
        }
      }
    }
    return false;
  }
1238993
private boolean hasSameStructure() {
        Object wrappedCollection = getWrappedValue();
        if (wrappedCollection == null) {
            return bufferedListModel.size() == 0;
        }
        else if (wrappedCollection instanceof Object[]) {
            Object[] wrappedArray = (Object[])wrappedCollection;
            if (wrappedArray.length != bufferedListModel.size()) {
                return false;
            }
            for (int i = 0; i < bufferedListModel.size(); i++) {
                if(super.hasValueChanged(wrappedArray[i], bufferedListModel.get(i))) {
                    return false;
                }
            }
        }
        else {
            if (((Collection)wrappedCollection).size() != bufferedListModel.size()) {
                return false;
            }
            for (Iterator i = ((Collection)wrappedCollection).iterator(), j = bufferedListModel.iterator(); i.hasNext();) {
                if (super.hasValueChanged(i.next(), j.next())) {
                    return false;
                }
            }
        }
        return true;
    }
1151773
boolean run(Iterable<? extends Archive> archives,
                Map<Location, Archive> locationMap)
    {
        this.locationToArchive.putAll(locationMap);

        // traverse and analyze all dependencies
        for (Archive archive : archives) {
            Dependences deps = new Dependences(archive, type);
            archive.visitDependences(deps);
            results.put(archive, deps);
        }
        return true;
    }
1369748
protected function doRestoreDB() {
		if ($this->Pipeline()->SkipSnapshot) return false;

		return $this->getConfigSetting('RestoreDB') && $this->Pipeline()->PreviousSnapshot();
	}
1317090
private boolean isCacheValid()
  {
    long now = CurrentTime.currentTime();

    if ((now - _lastTime < 100) && ! CurrentTime.isTest())
      return true;

    long oldLastModified = _lastModified;
    long oldLength = _length;
    
    long newLastModified = getBacking().getLastModified();
    long newLength = getBacking().length();
    
    _lastTime = now;

    if (newLastModified == oldLastModified && newLength == oldLength) {
      _lastTime = now;
      return true;
    }
    else {
      _changeSequence.incrementAndGet();
      
      // If the file has changed, close the old file
      clearCache();
      
      _zipEntryCache.clear();
      
      _lastModified = newLastModified;
      _length = newLength;
      
      _lastTime = now;

      return false;
    }
  }