@Implementation(minSdk = LOLLIPOP) protected void removeDefaultNetworkActiveListener(ConnectivityManager.OnNetworkActiveListener l) { if (l == null) { throw new IllegalArgumentException("Invalid OnNetworkActiveListener"); } if (onNetworkActiveListeners.contains(l)) { onNetworkActiveListeners.remove(l); } }
Iterator iterGrantorSerialNumbers = rmtGrantorSerialNumbers.iterator(); while (iterGrantorServices.hasNext()) { String serviceName = (String) iterGrantorServices.next(); long versionId = ((Long) iterGrantorVersions.next()).longValue(); int serialNumber = ((Integer) iterGrantorSerialNumbers.next()).intValue(); GrantorInfo oldgi = (GrantorInfo) this.grantors.get(serviceName); if (oldgi == null || oldgi.getVersionId() < versionId) { this.grantors.put(serviceName, new GrantorInfo(rmtId, versionId, serialNumber, false)); this.crashedGrantors.remove(serviceName); String serviceName = (String) it.next(); if (!this.grantors.containsKey(serviceName)) { this.crashedGrantors.add(serviceName);
outEdges.add(e); node.inEdges.add(e); return this; for(Node n : allNodes){ if(n.inEdges.size() == 0){ S.add(n); while(!S.isEmpty()){ Node n = S.iterator().next(); S.remove(n); Edge e = it.next(); Node m = e.to; m.inEdges.remove(e);//Remove edge from m if(m.inEdges.isEmpty()){ S.add(m); if(!n.inEdges.isEmpty()){ cycle = true; break;
HashSet<String> hs = sd.ackPositions.get(sequenceId); if (hs != null) { hs.remove(subscriptionKey); if (hs.isEmpty()) { HashSet<String> firstSet = sd.ackPositions.values().iterator().next(); sd.ackPositions.remove(sequenceId); Entry<Long, MessageRecord> entry = iterator.next(); if (entry.getKey().compareTo(sequenceId) <= 0) {
Iterator keyIt = keylist.iterator(); while (keyIt.hasNext()) { Object key = keyIt.next(); if (key instanceof ArrayRef) { outset.remove(key); Iterator keyIt = keylist.iterator(); while (keyIt.hasNext()) { Object key = keyIt.next(); if (key instanceof ArrayRef) { Value base = ((ArrayRef) key).getBase(); outset.remove(key); Object base = ((Array2ndDimensionSymbol) key).getVar(); if (base.equals(local)) { outset.remove(key); Iterator condIt = condset.iterator(); while (condIt.hasNext()) { if (inset.contains(condIt.next())) { outset.addAll(genset); break;
@Override public void run() { final HashSet<Long> set = new HashSet<>(initialCapacity); final long[] values = this.values; for (int i = 0; i < N; i++) { set.add(values[i]); } // check contains on every second key and remove it for (int i = 0; i < N; i++) { final long key = values[i] + i % 2; if (set.contains(key)) { set.remove(key); } } // remove the rest for (int i = 0; i < N; i++) { final long key = values[i]; if (set.contains(key)) { set.remove(key); } } }
private void onCheck(int position, View cell) { CheckBox checkBox = (CheckBox) cell.findViewById(R.id.card_checkbox); if (checkBox.isChecked()) { mCheckedCardPositions.add(position); } else { mCheckedCardPositions.remove(position); } updateMultiselectMenu(); if (mCheckedCardPositions.isEmpty()) { // when 0 are selected: end selection mode endMultiSelectMode(); } else { mActionBarTitle.setText(Integer.toString(mCheckedCardPositions.size())); } }
public HashSet<Statement> buildContinueSet() { continueSet.clear(); for (Statement st : stats) { continueSet.addAll(st.buildContinueSet()); if (st != first) { continueSet.remove(st.getBasichead()); } } for (StatEdge edge : getEdges(StatEdge.TYPE_CONTINUE, DIRECTION_FORWARD)) { continueSet.add(edge.getDestination().getBasichead()); } if (type == TYPE_DO) { continueSet.remove(first.getBasichead()); } return continueSet; }
@Override public void unlock(Session s) { if (database != null) { traceLock(s, lockExclusiveSession == s, "unlock"); if (lockExclusiveSession == s) { lockExclusiveSession = null; } synchronized (database) { if (!lockSharedSessions.isEmpty()) { lockSharedSessions.remove(s); } if (!waitingSessions.isEmpty()) { database.notifyAll(); } } } }
@Override public Object removeEntity(EntityKey key) { final Object entity = entitiesByKey.remove( key ); final Iterator itr = entitiesByUniqueKey.values().iterator(); while ( itr.hasNext() ) { if ( itr.next() == entity ) { itr.remove(); } } // Clear all parent cache parentsByChild.clear(); entitySnapshotsByKey.remove( key ); nullifiableEntityKeys.remove( key ); if( batchFetchQueue != null ) { getBatchFetchQueue().removeBatchLoadableEntityKey(key); getBatchFetchQueue().removeSubselect(key); } return entity; }
if (t instanceof AnySubType) { HashSet<SootClass> s = new HashSet<SootClass>(); s.add(declaringClass); while (!s.isEmpty()) { SootClass c = s.iterator().next(); s.remove(c); if (!c.isInterface() && !c.isAbstract() && canStoreClass(c, declaringClass)) { SootMethod concreteM = resolveConcreteDispatch(c, m);
Iterator<TopoProfileAction> iter = mod.iterator(); while (iter.hasNext()) { TopoProfileAction action = iter.next(); if (!action.topoId.equals(dynamicState.currentAssignment.get_topology_id())) { iter.remove(); if (modPending.contains(action)) { boolean isTimeForStop = Time.currentTimeMillis() > action.request.get_time_stamp(); if (isTimeForStop) { LOG.debug("Stopped {} action finished", action); iter.remove(); modPending.remove(action); } else { LOG.warn("Stopping {} failed, will be retried", action); modPending.add(action); LOG.debug("Started {} now: {}", action, Time.currentTimeMillis()); } else {
candidates.remove(self.getId()); // if we're here, I shouldn't be the leader long curCandidate = candidates.iterator().next(); Proposal p = outstandingProposals.get(curZxid); while (p!=null && !candidates.isEmpty()) { for (Proposal.QuorumVerifierAcksetPair qvAckset: p.qvAcksetPairs){ if (candidates.isEmpty()) return curCandidate; curCandidate = candidates.iterator().next(); if (candidates.size() == 1) return curCandidate;