void (ReferenceType classType, BiConsumer<? super ReferenceType, ? super ClassesByNameProvider> consumer, ProgressIndicator progressIndicator) { long start = 0; if (LOG.isDebugEnabled()) { start = System.currentTimeMillis(); } progressIndicator.setIndeterminate(false); progressIndicator.start(); progressIndicator.setText(JavaDebuggerBundle.message("label.method.breakpoints.processing.classes")); try { MultiMap<ReferenceType, ReferenceType> inheritance = MultiMap.createConcurrentSet(); List<ReferenceType> allTypes = classType.virtualMachine().allClasses(); int allSize = allTypes.size(); List<CompletableFuture> futures = new ArrayList<>(); AtomicInteger processed = new AtomicInteger(); for (ReferenceType type : allTypes) { if (progressIndicator.isCanceled()) { return; } if (type.isPrepared()) { futures.add(DebuggerUtilsAsync.supertypes(type) .thenAccept(supertypes -> supertypes.forEach(st -> inheritance.putValue(st, type))) .exceptionally(throwable -> { throwable = DebuggerUtilsAsync.unwrap(throwable); if (throwable instanceof ObjectCollectedException) { return null; } throw new CompletionException(throwable); }) .thenRun(() -> updateProgress(progressIndicator, processed.incrementAndGet(), allSize))); } } CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join(); List<ReferenceType> types = StreamEx.ofTree(classType, t -> StreamEx.of(inheritance.get(t))).skip(1).toList(); if (LOG.isDebugEnabled()) { long current = System.currentTimeMillis(); LOG.debug("Processed " + allSize + " classes in " + (current - start) + "ms"); start = current; } progressIndicator.setText(JavaDebuggerBundle.message("label.method.breakpoints.setting.breakpoints")); ClassesByNameProvider classesByName = ClassesByNameProvider.createCache(allTypes); int typesSize = types.size(); for (int i = 0; i < typesSize; i++) { if (progressIndicator.isCanceled()) { return; } consumer.accept(types.get(i), classesByName); updateProgress(progressIndicator, i, typesSize); } if (LOG.isDebugEnabled()) { LOG.debug("Created " + typesSize + " requests in " + (System.currentTimeMillis() - start) + "ms"); } } finally { progressIndicator.stop(); } }