Skip to content

Commit 4e0ec92

Browse files
committed
fix performance issue when removing projects with lots of symbols from workspace
1 parent 0962558 commit 4e0ec92

File tree

1 file changed

+2
-2
lines changed
  • headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app

1 file changed

+2
-2
lines changed

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/SpringSymbolIndex.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1121,9 +1121,9 @@ private void removeSymbolsByProject(IJavaProject project) {
11211121
List<WorkspaceSymbol> oldSymbols = symbolsByProject.remove(project.getElementName());
11221122
if (oldSymbols != null) {
11231123

1124-
List<WorkspaceSymbol> copy = null;
1124+
Set<WorkspaceSymbol> copy = null;
11251125
synchronized(oldSymbols) {
1126-
copy = new ArrayList<>(oldSymbols);
1126+
copy = new HashSet<>(oldSymbols); // use HashSet here in order to speed up removal of symbols from global list
11271127
}
11281128

11291129
synchronized(this.symbols) {

0 commit comments

Comments
 (0)