Don't use parallelStream to keep number of threads down

This commit is contained in:
aboyko
2023-01-30 12:42:18 -05:00
parent d115a2dec1
commit 8c53ca8768
4 changed files with 4 additions and 3 deletions

View File

@@ -69,6 +69,7 @@ public class JavaData {
return createTypeData((IType) element);
}
} catch (Exception e) {
logger.log("Failed to fetch type data for element witn key: " + bindingKey);
logger.log(e);
}
return null;

View File

@@ -547,7 +547,7 @@ public class SpringSymbolIndex implements InitializingBean {
}
public Stream<WorkspaceSymbol> getSymbols(Predicate<EnhancedSymbolInformation> filter) {
return symbols.parallelStream()
return symbols.stream()
.filter(filter)
.map(enhanced -> enhanced.getSymbol());
}

View File

@@ -339,7 +339,7 @@ public class PropertiesCompletionProposalsCalculator {
Collection<Match<PropertyInfo>> matches = findMatches(prefix);
if (matches!=null && !matches.isEmpty()) {
ArrayList<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(matches.size());
matches.parallelStream().forEach(match -> {
matches.stream().forEach(match -> {
DocumentEdits docEdits;
try {
docEdits = LazyProposalApplier.from(() -> {

View File

@@ -466,7 +466,7 @@ public abstract class ApplicationYamlAssistContext extends AbstractYamlAssistCon
Collection<Match<PropertyInfo>> matchingProps = indexNav.findMatching(query);
if (!matchingProps.isEmpty()) {
ArrayList<ICompletionProposal> completions = new ArrayList<ICompletionProposal>();
matchingProps.parallelStream().forEach(match -> {
matchingProps.stream().forEach(match -> {
try {
DocumentEdits edits = createEdits(doc, node, offset, query, match);
ScoreableProposal completion = completionFactory.property(