private Object[] copyMappedFiles(final int reservedMappedFiles) { Object[] mfs; if (this.mappedFiles.size() <= reservedMappedFiles) { return null; } mfs = this.mappedFiles.toArray(); return mfs; }
/** * Returns an array containing all of the elements in this set. * If this set makes any guarantees as to what order its elements * are returned by its iterator, this method must return the * elements in the same order. * * <p>The returned array will be "safe" in that no references to it * are maintained by this set. (In other words, this method must * allocate a new array even if this set is backed by an array). * The caller is thus free to modify the returned array. * * <p>This method acts as bridge between array-based and collection-based * APIs. * * @return an array containing all the elements in this set */ public Object[] toArray() { return al.toArray(); }
return al.toArray(a);
private Object[] copyMappedFiles(final int reservedMappedFiles) { Object[] mfs; if (this.mappedFiles.size() <= reservedMappedFiles) { return null; } mfs = this.mappedFiles.toArray(); return mfs; }
/** * Copies the collection of listeners so they can be iterated on without changing. * From the returned copy events may be fired. * Any addition or removal of listeners will take effect on the next cycle. */ Listeners listeners() { return new Listeners(eventListeners.toArray(new HollowProducerEventListener[0])); }
@Override public void close() throws IOException { alive.set(false); try { server.close(); } finally { closeQuietly(handles.toArray(new Closeable[]{})); closeExecutor(executorService); } }
public void finishVerification(ActionListener<VerifyResponse> listener, List<DiscoveryNode> nodes, CopyOnWriteArrayList<VerificationFailure> errors) { listener.onResponse(new RepositoriesService.VerifyResponse(nodes.toArray(new DiscoveryNode[nodes.size()]), errors.toArray(new VerificationFailure[errors.size()]))); }
/** {@inheritDoc} */ @Override public FrameData[] getKeyframes() { return keyframes.toArray(new FrameData[0]); }
@Override public Object[] toArray() { return entries.toArray(); }
private Object[] copyMappedFiles(final int reservedMappedFiles) { Object[] mfs; if (this.mappedFiles.size() <= reservedMappedFiles) { return null; } mfs = this.mappedFiles.toArray(); return mfs; }
private Object[] copyMappedFiles(final int reservedMappedFiles) { if (this.mappedFiles.size() <= reservedMappedFiles) { return null; } Object[] mfs = this.mappedFiles.toArray(); return mfs; }
private void refreshCopy() { ourCopy = underlyingList.toArray(modelArray); fresh.set(true); }
private Object[] copyMappedFiles() { if (this.mappedFiles.size() <= 0) { return null; } return this.mappedFiles.toArray(); }
public void subscribe(Object o) { listeners.add(o); for(Runnable callback : onSubscription.toArray(new Runnable[]{})){ callback.run(); } }
@PreDestroy public void preShutdown() { // Shutdown the service. // To avoid the CurrentModificationException, do not use serversList directly Object[] servers = serversList.toArray(); for (int i = 0; i < servers.length; i++) { Server server = (Server) servers[i]; server.destroy(); } }
@PreDestroy public void preShutdown() { // Shutdown the service. // To avoid the CurrentModificationException, do not use serversList directly Object[] servers = serversList.toArray(); for (int i = 0; i < servers.length; i++) { Server server = (Server) servers[i]; server.destroy(); } }
@PreDestroy public void preShutdown() { // Shutdown the service. // To avoid the CurrentModificationException, do not use serversList directly Object[] servers = serversList.toArray(); for (int i = 0; i < servers.length; i++) { Server server = (Server) servers[i]; server.destroy(); } }
@Override public void abort() { for (ICancellable listener : listeners.toArray(new ICancellable[0])) { try { listener.abort(); } catch (Exception e) { // ignore } } }
@SuppressWarnings("unchecked") private void onActiveClientListChanged() { this.selectionStrategy.setClients((C[]) activeClients.toArray()); }
refreshListeners.toArray(new HollowConsumer.RefreshListener[0]);