public void push( ObjectInputStream in ) { wrappedStack.push(in); wrapped = in; }
@Override public void enterNested(RuleLangParser.NestedContext ctx) { // nested field access is ok, these are not rule variables isIdIsFieldAccess.push(true); }
@Override public void enterMessageRef(RuleLangParser.MessageRefContext ctx) { // nested field access is ok, these are not rule variables isIdIsFieldAccess.push(true); }
/** * Marks the given <code>NativeObject</code> as unused, * to be deleted on the next frame. * Usage of this object after deletion will cause an exception. * Note that native buffers are only reclaimed if * {@link #UNSAFE} is set to <code>true</code>. * * @param obj The object to mark as unused. */ void enqueueUnusedObject(NativeObject obj) { userDeletionQueue.push(obj); }
public void push( ObjectInputStream in ) { wrappedStack.push(in); wrapped = in; }
/** * This BstIterator manages to use O(h) extra space, where h is the height of the tree It achieves * this by maintaining a stack of the nodes to handle (pushing all left nodes first), before * handling self or right node * * @param node TreeNode that acts as root of the subtree we're interested in. */ private void pushPathToNextSmallest(TreeNode<T> node) { while (node != null) { pathStack.push(node); node = node.getLeft(); } }
private void offer(T theObject) { final ReentrantLock lock = this.lock; lock.lock(); try { if (objects.size() < maxSize) { objects.push(theObject); notEnough.signal(); } else { throw new ISE("Cannot exceed pre-configured maximum size"); } } finally { lock.unlock(); } } }
public void pushNdc(String message) { ArrayDeque<Entry> stack = ndcStack.get(); if (stack == null) { stack = new ArrayDeque<Entry>(); ndcStack.set(stack); } stack.push(stack.isEmpty() ? new Entry(message) : new Entry(stack.peek(), message)); }
private static void findUnannotatedTypeVarRefs( TypeVariableSymbol typeVar, Tree sourceNode, Type type, ArrayDeque<Integer> partialSelector, ImmutableSet.Builder<InferenceVariable> resultBuilder) { List<Type> typeArguments = type.getTypeArguments(); for (int i = 0; i < typeArguments.size(); i++) { partialSelector.push(i); findUnannotatedTypeVarRefs( typeVar, sourceNode, typeArguments.get(i), partialSelector, resultBuilder); partialSelector.pop(); } if (type.tsym.equals(typeVar) && !toNullness(type.getAnnotationMirrors()).isPresent()) { resultBuilder.add( TypeArgInferenceVar.create(ImmutableList.copyOf(partialSelector), sourceNode)); } }
public RuleAstBuilder(ParseContext parseContext) { this.parseContext = parseContext; args = parseContext.arguments(); argsList = parseContext.argumentLists(); exprs = parseContext.expressions(); isIdIsFieldAccess.push(false); // top of stack }
private void generateConstraintsFromAnnotations( Type type, Tree sourceTree, ArrayDeque<Integer> argSelector) { List<Type> typeArguments = type.getTypeArguments(); int numberOfTypeArgs = typeArguments.size(); for (int i = 0; i < numberOfTypeArgs; i++) { argSelector.push(i); generateConstraintsFromAnnotations(typeArguments.get(i), sourceTree, argSelector); argSelector.pop(); } // Use equality constraints even for top-level type, since we want to "trust" the annotation // TODO(b/121398981): skip for T extends @<Annot> since they constrain one side only ProperInferenceVar.fromTypeIfAnnotated(type) .ifPresent( annot -> { qualifierConstraints.putEdge( TypeArgInferenceVar.create(ImmutableList.copyOf(argSelector), sourceTree), annot); qualifierConstraints.putEdge( annot, TypeArgInferenceVar.create(ImmutableList.copyOf(argSelector), sourceTree)); }); }
private void generateConstraintsFromAnnotations( MethodSymbol symbol, JCMethodInvocation sourceTree, ArrayDeque<Integer> argSelector) { List<Type> typeArguments = sourceTree.type.getTypeArguments(); int numberOfTypeArgs = typeArguments.size(); for (int i = 0; i < numberOfTypeArgs; i++) { argSelector.push(i); generateConstraintsFromAnnotations(typeArguments.get(i), sourceTree, argSelector); argSelector.pop(); } // First check if the given symbol is directly annotated; if not, look for implicit annotations // on the inferred type of the expression. The latter for instance propagates a type parameter // T instantiated as <@Nullable String> to the result of a method returning T. Optional<InferenceVariable> fromAnnotations = Nullness.fromAnnotationsOn(symbol).map(ProperInferenceVar::create); if (!fromAnnotations.isPresent()) { fromAnnotations = ProperInferenceVar.fromTypeIfAnnotated(sourceTree.type); } // Use equality constraints here, since we want to "trust" the annotation. For instance, // a method return annotated @Nullable requires us assume the method might really return null, // and a method return annotated @Nonnull should allow us to assume it really returns non-null. fromAnnotations.ifPresent( annot -> { qualifierConstraints.putEdge( TypeArgInferenceVar.create(ImmutableList.copyOf(argSelector), sourceTree), annot); // TODO(b/121398981): skip for T extends @<Annot> since they constrain one side only qualifierConstraints.putEdge( annot, TypeArgInferenceVar.create(ImmutableList.copyOf(argSelector), sourceTree)); }); }
} while(!startTag.name.equals(tagName)); } else if (!isVoidTag) { startTagStack.push(StartTag.buildStartTag(fullTagExpression, spannedText.length()));
List<Type> typeArguments = lType.getTypeArguments(); for (int i = 0; i < typeArguments.size(); i++) { argSelector.push(i); generateConstraintsForWrite(typeArguments.get(i), rVal, lVal, argSelector); argSelector.pop();
try { TtmlNode node = parseNode(xmlParser, parent, regionMap, frameAndTickRate); nodeStack.push(node); if (parent != null) { parent.addChild(node);
containerAtoms.push(new ContainerAtom(atomType, endPosition)); if (atomSize == atomHeaderBytesRead) { processAtomEnded(endPosition);
containerAtoms.push(new ContainerAtom(atomType, endPosition)); if (atomSize == atomHeaderBytesRead) { processAtomEnded(endPosition);
long elementContentPosition = input.getPosition(); long elementEndPosition = elementContentPosition + elementContentSize; masterElementsStack.push(new MasterElement(elementId, elementEndPosition)); output.startMasterElement(elementId, elementContentPosition, elementContentSize); elementState = ELEMENT_STATE_READ_ID;