@Override public void run() { snapshotList.addLast(statsBenchmark.createSnapshot()); if (snapshotList.size() > 10) { snapshotList.removeFirst(); } } }, 1000, 1000);
public void outASingleParameterList(ASingleParameterList node) { List<Type> l = new ArrayList<Type>(); l.add((Type) mProductions.removeLast()); mProductions.addLast(l); }
static StackTraceElement[] trimStackTrace(StackTraceElement[] stackTrace) { LinkedList<StackTraceElement> list = Lists.newLinkedList(); for (int i = stackTrace.length - 1; i >= 0; i--) { StackTraceElement s = stackTrace[i]; if (s.getClassName().startsWith(Checkers.class.getPackage().getName())) { break; } list.addLast(s); } return list.toArray(new StackTraceElement[list.size()]); }
public void outAThrowsClause(AThrowsClause node) { List l = (List) mProductions.removeLast(); Iterator it = l.iterator(); List<SootClass> exceptionClasses = new ArrayList<SootClass>(l.size()); while (it.hasNext()) { String className = (String) it.next(); exceptionClasses.add(mResolver.makeClassRef(className)); } mProductions.addLast(exceptionClasses); } }
private void logicalClose(Session proxy) throws JMSException { // Preserve rollback-on-close semantics. if (this.transactionOpen && this.target.getTransacted()) { this.transactionOpen = false; this.target.rollback(); } // Physically close durable subscribers at time of Session close call. for (Iterator<Map.Entry<ConsumerCacheKey, MessageConsumer>> it = this.cachedConsumers.entrySet().iterator(); it.hasNext();) { Map.Entry<ConsumerCacheKey, MessageConsumer> entry = it.next(); if (entry.getKey().subscription != null) { entry.getValue().close(); it.remove(); } } // Allow for multiple close calls... boolean returned = false; synchronized (this.sessionList) { if (!this.sessionList.contains(proxy)) { this.sessionList.addLast(proxy); returned = true; } } if (returned && logger.isTraceEnabled()) { logger.trace("Returned cached Session: " + this.target); } }
if ( pathElements.isEmpty() ) pathElements.removeLast(); pathElements.addLast( token ); while ( !pathElements.isEmpty() ) cleanedPath.append( pathElements.removeFirst() ); if ( !pathElements.isEmpty() )
public BitSet getTransitiveOutputSet(int input) { BitSet visited = new BitSet(); BitSet result = new BitSet(); LinkedList<Integer> workList = new LinkedList<>(); workList.addLast(input); while (!workList.isEmpty()) { Integer valueNumber = workList.removeFirst(); visited.set(valueNumber); BitSet outputSet = getOutputSet(valueNumber); result.or(outputSet); for (int i = outputSet.nextSetBit(0); i >= 0; i = outputSet.nextSetBit(i+1)) { if (!visited.get(i)) { workList.addLast(i); } } } return result; }
/** * 转换LIST * @param val */ private void convertList(List<?> val){ if(paths.size() <= 0){ paths.add("[]"); }else{ paths.addLast(paths.removeLast() + "[]"); } for(int i = 0; i < val.size(); i++){ arrayIndex.addLast(i); each(val.get(i)); arrayIndex.removeLast(); } }
} else { if (operand == '0' || operand == '1') { list.addLast(operand); list.addLast(curr); operand = '\0'; } else { list.addLast(operand); list.addLast('#'); operand = list.pop(); while (!list.isEmpty()) { char curr = list.pop(); if (curr == '&') { } else { if (operand == '0' || operand == '1') { list.addLast(operand); list.addLast(curr); operand = '\0'; } else { list.addLast(operand); while (!list.isEmpty() && (operand = list.pop()) != '1'); return operand;
indexStack.addLast(-1); while (!stmtStack.isEmpty()) { int toVisitIndex = indexStack.removeLast(); N toVisitNode = stmtStack.getLast();
/** * After a message queue has changed we may need to perform some evictions * * @param delta * @param queueSize */ public void onSizeChanged(MessageQueue queue, int delta, int queueSize) { synchronized (lock) { list.addLast(queue); size += delta; while (size > limit) { MessageQueue biggest = list.removeFirst(); size -= biggest.evictMessage(); } } }
public void outAThrowsClause(AThrowsClause node) { List l = (List) mProductions.removeLast(); Iterator it = l.iterator(); List<SootClass> exceptionClasses = new ArrayList<SootClass>(l.size()); while (it.hasNext()) { String className = (String) it.next(); exceptionClasses.add(mResolver.makeClassRef(className)); } mProductions.addLast(exceptionClasses); }
public List<Unit> getUnits() { if (this.m_units == null) { this.m_units = new LinkedList<Unit>(); for (Iterator<Block> itr = this.m_blocks.iterator(); itr.hasNext();) { Block b = itr.next(); for (Iterator<Unit> itr1 = b.iterator(); itr1.hasNext();) { Unit u = itr1.next(); ((LinkedList<Unit>) this.m_units).addLast(u); } } } return this.m_units; }
if ( pathElements.isEmpty() ) pathElements.removeLast(); pathElements.addLast( token ); break; while ( !pathElements.isEmpty() ) cleanedPath.append( pathElements.removeFirst() ); if ( !pathElements.isEmpty() )
private static void addDebuggingLog(String level, String msg) { synchronized (DEBUGGING_LOGS) { DEBUGGING_LOGS.addLast(new Date().toString() + '\t' + level + '\t' + msg); while (DEBUGGING_LOGS.size() > MAX_DEBUGGING_LOGS_COUNT) { DEBUGGING_LOGS.removeFirst(); } } }
LinkedList<T> queue = new LinkedList<>(); visited.add(o); queue.addLast(o); while (! queue.isEmpty()) { for (T obj : getPredecessors(queue.removeFirst())) { if (! visited.contains(obj)) { visited.add(obj); queue.addLast(obj); result.addFirst(obj);
private void closeExpression(QueryTranslatorImpl q, String lcToken) { if ( booleanTests.removeLast() ) { //it was a boolean expression if ( booleanTests.size() > 0 ) { // the next one up must also be booleanTests.removeLast(); booleanTests.addLast( Boolean.TRUE ); } // Add any joins appendToken( q, ( joins.removeLast() ).toString() ); } else { StringBuilder join = joins.removeLast(); joins.getLast().append( join.toString() ); } if ( nots.removeLast() ) { negated = !negated; } if ( !")".equals( lcToken ) ) { appendToken( q, ")" ); } }
void doRespond(RpcCall call) throws IOException { synchronized (call.connection.responseQueue) { // must only wrap before adding to the responseQueue to prevent // postponed responses from being encrypted and sent out of order. if (call.connection.useWrap) { wrapWithSasl(call); } call.connection.responseQueue.addLast(call); if (call.connection.responseQueue.size() == 1) { processResponse(call.connection.responseQueue, true); } } }
public void outAMultiArgList(AMultiArgList node) { List<Value> l = (List<Value>) mProductions.removeLast(); l.add(0, (Value) mProductions.removeLast()); mProductions.addLast(l); }