Refine search
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) { Assert.notNull(clazz, "Class must not be null"); Assert.notNull(methodName, "Method name must not be null"); if (paramTypes != null) { try { return clazz.getMethod(methodName, paramTypes); } catch (NoSuchMethodException var9) { throw new IllegalStateException("Expected method not found: " + var9); } } else { HashSet candidates = new HashSet(1); Method[] methods = clazz.getMethods(); Method[] arr$ = methods; int len$ = methods.length; for (int i$ = 0; i$ < len$; ++i$) { Method method = arr$[i$]; if (methodName.equals(method.getName())) { candidates.add(method); } } if (candidates.size() == 1) { return (Method) candidates.iterator().next(); } else if (candidates.isEmpty()) { throw new IllegalStateException("Expected method not found: " + clazz + "." + methodName); } else { throw new IllegalStateException("No unique method found: " + clazz + "." + methodName); } } }
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) {
Map.Entry<String, JobSchedulerImpl> entry = i.next(); JobSchedulerImpl scheduler = entry.getValue(); Map.Entry<String, JobSchedulerImpl> entry = i.next(); JobSchedulerImpl scheduler = entry.getValue(); missingJournalFiles.add(job.getLocation().getDataFileId()); if (job.getLastUpdate() != null) { missingJournalFiles.add(job.getLastUpdate().getDataFileId()); if (!missingJournalFiles.isEmpty()) { LOG.info("Some journal files are missing: {}", missingJournalFiles); int id = dataFile.getDataFileId(); for (long offset : dataFile.getCorruptedBlocks()) { corruptedLocations.add(new Location(id, (int) offset)); if (!corruptedLocations.isEmpty()) { LOG.debug("Found some corrupted data blocks in the journal: {}", corruptedLocations.size()); if (!missingJournalFiles.isEmpty() || !corruptedLocations.isEmpty()) { if (!isIgnoreMissingJournalfiles()) { throw new IOException("Detected missing/corrupt journal files.");
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())); } }
else if (!F.eq(grpDesc.deploymentId(), curGrpDesc.deploymentId())) { return errorFuture("Cannot change WAL mode for caches from different cache groups [" + "cache1=" + cacheNames.iterator().next() + ", grp1=" + grpDesc.groupName() + ", cache2=" + cacheName + ", grp2=" + curGrpDesc.groupName() + ']'); if (!grpCaches.isEmpty()) { return errorFuture("Cannot change WAL mode because not all cache names belonging to the group are " + "provided [group=" + grpDesc.groupName() + ", missingCaches=" + grpCaches + ']');
/** * Given a column name and a set of pdx types, find the field name in those types that match, * ignoring case, the column name. * * @return the matching field name or null if no match * @throws JdbcConnectorException if no fields match * @throws JdbcConnectorException if more than one field matches */ private String findCaseInsensitiveMatch(String columnName, Set<PdxType> pdxTypes) { HashSet<String> matchingFieldNames = new HashSet<>(); for (PdxType pdxType : pdxTypes) { for (String existingFieldName : pdxType.getFieldNames()) { if (existingFieldName.equalsIgnoreCase(columnName)) { matchingFieldNames.add(existingFieldName); } } } if (matchingFieldNames.isEmpty()) { throw new JdbcConnectorException("The class " + getPdxName() + " does not have a field that matches the column " + columnName); } else if (matchingFieldNames.size() > 1) { throw new JdbcConnectorException( "Could not determine what pdx field to use for the column name " + columnName + " because the pdx fields " + matchingFieldNames + " all match it."); } return matchingFieldNames.iterator().next(); }
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);
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;
public void execute() throws Pausable { while (!tasks.isEmpty() || addedTasksMB.hasMessage()) { switch (Mailbox.select(addedTasksMB, exitmb)) { case 0: Task t = addedTasksMB.getnb(); t.informOnExit(exitmb); tasks.add(t); break; case 1: ExitMsg em = exitmb.getnb(); results.add(em); tasks.remove(em.task); break; } } exit(results); }
public BugInstance addOptionalUniqueAnnotationsWithFallback(BugAnnotation fallback, BugAnnotation... annotations) { HashSet<BugAnnotation> added = new HashSet<>(); for (BugAnnotation a : annotations) { if (a != null && added.add(a)) { add(a); } } if (added.isEmpty()) { add(fallback); } return this; }
@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(); } } } }
Map.Entry me = (Map.Entry) it.next(); RegionCommitList rcl = (RegionCommitList) me.getValue(); if (rcl.getNeedsAck()) { ackReceivers = new HashSet(); ackReceivers.add(me.getKey()); distMap.put(rcl, receivers); receivers.add(me.getKey()); Map.Entry me = (Map.Entry) it.next(); RegionCommitList rcl = (RegionCommitList) me.getKey(); HashSet recipients = (HashSet) me.getValue(); if (!recipients.isEmpty()) { if (this.txState.internalDuringIndividualSend != null) { while (indivRecip.hasNext()) { this.txState.internalDuringIndividualSend.run(); setRecipientsSendData(Collections.singleton(indivRecip.next()), processor, rcl);
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);
setPreds.remove(first); if (!setPreds.isEmpty()) { Statement pred = setPreds.iterator().next(); // assumption: at most one predecessor node besides the head. May not hold true for obfuscated code. for (int j = 0; j < nodes.size(); j++) { if (j != (index - 1) && nodes.get(j) == pred) { edge.closure.getLabelEdges().remove(edge);