Root method that branches for different implementations of {@link KeyedStateHandle}.
762640
@Override
	public RocksDBRestoreResult restore() throws Exception {

		if (restoreStateHandles == null || restoreStateHandles.isEmpty()) {
			return null;
		}

		final KeyedStateHandle theFirstStateHandle = restoreStateHandles.iterator().next();

		boolean isRescaling = (restoreStateHandles.size() > 1 ||
			!Objects.equals(theFirstStateHandle.getKeyGroupRange(), keyGroupRange));

		if (isRescaling) {
			restoreWithRescaling(restoreStateHandles);
		} else {
			restoreWithoutRescaling(theFirstStateHandle);
		}
		return new RocksDBRestoreResult(this.db, defaultColumnFamilyHandle,
			nativeMetricMonitor, lastCompletedCheckpointId, backendUID, restoredSstFiles);
	}
600244
function Delegate(root) {

  /**
   * Maintain a map of listener
   * lists, keyed by event name.
   *
   * @type Object
   */
  this.listenerMap = [{}, {}];
  if (root) {
    this.root(root);
  }

  /** @type function() */
  this.handle = Delegate.prototype.handle.bind(this);
}
1313967
private void handleSelectedKeys() {
    Set<SelectionKey> selectedKeys = selector.selectedKeys();
    Iterator<SelectionKey> keyIterator = selectedKeys.iterator();
    while (keyIterator.hasNext()) {
      SelectionKey key = keyIterator.next();
      keyIterator.remove();

      ISelectHandler callback = (ISelectHandler) key.attachment();

      if (!key.isValid()) {
        // This method key.channel() will continue to return the channel even after the
        // key is cancelled.
        callback.handleError(key.channel());
        continue;
      }

      // We need to check whether the key is still valid since:
      // 1. The key could be cancelled by last operation
      // 2. The process might not fail-fast or throw exceptions after the key is cancelled
      if (key.isValid() && key.isWritable()) {
        callback.handleWrite(key.channel());
      }

      if (key.isValid() && key.isReadable()) {
        callback.handleRead(key.channel());
      }

      if (key.isValid() && key.isConnectable()) {
        callback.handleConnect(key.channel());
      }

      if (key.isValid() && key.isAcceptable()) {
        callback.handleAccept(key.channel());
      }

    }
  }
863719
public static Throwable getRootCause(Throwable t) {
        if (t == null) {
            return null;
        }
        while (t.getCause() != null) {
            t = t.getCause();
        }
        return t;
    }
1336389
@Override
    public boolean handles(String command) {
        if (command.startsWith(this.tree.getTopNode().getData())) {
            return true;
        }
        return false;
    }
640753
function mapStateToProps(state) {

				// initialize return object
				var mappedState = {};

				// populate return object
				keys.forEach(function (key) {

					// add selector connection
					if (key.split(':').length === 2 && selectors[key.split(':')[1]]) {
						mappedState[key.split(':')[0]] = selectors[key.split(':')[1]](state);

						// add branch connection
					} else if (state[key]) {
						mappedState[key] = state[key].toJS();
					}
				});

				return shouldReturnAFunction ? function (state, props) {
					return mappedState;
				} : mappedState;
			}
1142560
function createReducer (branchName, defaultState = {}) {
    return (state = fromJS(defaultState), action) => {
        const { keyArray, value, updateFunction, operation, location } = action
        switch (action.type) {
        case branchName:
            // TODO add control flow to handle immutable methods
            return location.length > 0
              ? state[operation]( location, updateFunction || fromJS(value) || undefined )
              : fromJS(value)
        default:
            return state
        }
    }
}
753132
@Override
    public void sawOpcode(int seen) {
        if (downwardBranchTarget == -1) {
            switch (state) {
                case SAW_NOTHING:
                    sawOpcodeAfterNothing(seen);
                break;

                case SAW_LOAD:
                    sawOpcodeAfterLoad(seen);
                break;

                case SAW_CHECKCAST:
                    sawOpcodeAfterCheckCast(seen);
                break;
            }

            int insTarget = -1;
            if (((seen >= Const.IFEQ) && (seen <= Const.IF_ACMPNE)) || (seen == Const.GOTO) || (seen == Const.GOTO_W)) {
                insTarget = getBranchTarget();
                if (insTarget < getPC()) {
                    insTarget = -1;
                }
            } else if ((seen == Const.LOOKUPSWITCH) || (seen == Const.TABLESWITCH)) {
                insTarget = this.getDefaultSwitchOffset() + getPC();
            }

            if (insTarget > downwardBranchTarget) {
                downwardBranchTarget = insTarget;
            }
        } else {
            state = State.SAW_NOTHING;
            if (getPC() >= downwardBranchTarget) {
                downwardBranchTarget = -1;
            }
        }
    }
189452
private final K getRoundKey(final K key, final boolean upORdown, final boolean acceptEqual) {
		final TreeEntry<K, V> entry = getRoundEntry(key, upORdown, acceptEqual);
		if (entry == null) {
			return null;
		}
		return entry.getKey();
	}
259658
private void addPropertyStateExtractMethod() {
        MethodInfo mi = mClassFile.addMethod(Modifiers.PRIVATE, PROPERTY_STATE_EXTRACT_METHOD_NAME,
                                             TypeDesc.INT, new TypeDesc[] {TypeDesc.STRING});

        addPropertySwitch(new CodeBuilder(mi), SWITCH_FOR_STATE);
    }
234997
function(root) {
          var pindex = 0, // avoid array alloc for every invocation
            ret = [],
            tp;
          while (tp = parts[pindex++]) {
            ret = ret.concat(getStepQueryFunc(tp)(root));
          }
          return ret;
        }
610676
public static Map<String, Object> getConfigForBranch(State taskState, int numBranches, int branch) {
    String typePropertyName =
        ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_CODEC_TYPE, numBranches, branch);
    String compressionType = taskState.getProp(typePropertyName);
    if (compressionType == null) {
      return null;
    }

    return ImmutableMap.<String, Object>of(COMPRESSION_TYPE_KEY, compressionType);
  }
540802
public LoggingFraction rootLogger(Level level, String... handlers) {
        rootLogger(new RootLogger().level(level)
                .handlers(handlers));
        return this;
    }
678286
@Nullable
  private Drawable buildBranch(
      @Nullable Drawable drawable, @Nullable ScalingUtils.ScaleType scaleType) {
    drawable = WrappingUtils.maybeApplyLeafRounding(drawable, mRoundingParams, mResources);
    drawable = WrappingUtils.maybeWrapWithScaleType(drawable, scaleType);
    return drawable;
  }
547776
@Nonnull
	public final LObjIntCharFunctionBuilder<T, R> withHandling(@Nonnull HandlingInstructions<RuntimeException, RuntimeException> handling) {
		Null.nonNullArg(handling, "handling");
		if (this.handling != null) {
			throw new UnsupportedOperationException("Handling is already set for this builder.");
		}
		this.handling = handling;
		return self();
	}
728052
void root(ProtoType type) {
    if (type == null) throw new NullPointerException("type == null");
    checkArgument(!identifierSet.excludes(type));
    checkArgument(!members.containsKey(type));
    types.add(type);
  }
959104
public List<JCCompilationUnit> enterTreesIfNeeded(List<JCCompilationUnit> roots) {
       if (shouldStop(CompileState.ATTR))
           return List.nil();
        return enterTrees(roots);
    }