Skip to content

Commit 490970e

Browse files
dzharkovSpace Team
authored andcommitted
Adjust KotlinJavaPsiFacade::knownClassNamesInPackage for empty scope
The method must return an empty set in that case, instead of null that would mean we can't compute it. The problem was found when running FirLoadCompiledKotlinGenerated
1 parent 9c988fd commit 490970e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/resolution.common.jvm/src/org/jetbrains/kotlin/resolve/jvm/KotlinJavaPsiFacade.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@
5252
import org.jetbrains.kotlin.name.FqName;
5353
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus;
5454

55-
import java.util.ArrayList;
56-
import java.util.Arrays;
57-
import java.util.List;
58-
import java.util.Set;
55+
import java.util.*;
5956
import java.util.concurrent.ConcurrentHashMap;
6057
import java.util.concurrent.ConcurrentMap;
6158

@@ -214,9 +211,12 @@ private static JavaClass createJavaClass(@NotNull ClassId classId, @NotNull PsiC
214211
return javaClass;
215212
}
216213

214+
/**
215+
* @return null in case the set of names is impossible to compute correctly
216+
*/
217217
@Nullable
218218
public Set<String> knownClassNamesInPackage(@NotNull FqName packageFqName, @NotNull GlobalSearchScope scope) {
219-
if (scope == GlobalSearchScope.EMPTY_SCOPE) return null;
219+
if (scope == GlobalSearchScope.EMPTY_SCOPE) return Collections.emptySet();
220220

221221
KotlinPsiElementFinderWrapper[] finders = finders();
222222

0 commit comments

Comments
 (0)