You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
Invoking ProjectManager.getAllFiles() (or more explicitly, ProjectManager.getAllFiles(null, false)) often yields an array that includes files outside the project that are open in the working set. This happens any time someone has called ProjectManager.getAllFiles(true) earlier.
Most callers supposedly don't want working-set entries that are outside the project -- only Find in Files & Quick Open pass true. But since this bug has existed seemingly since Sprint 36 (a7a551d), those callers have been getting project-external items in the result list anyway. So presumably this doesn't cause any major ill effects for most callers.
This happens because getAllFiles() reuses a cached result, and when includeWorkingSet is true it modifies the cache in-place to include the extra files. It should make a copy instead to prevent tainting the cache used by future callers.
The text was updated successfully, but these errors were encountered:
Fwiw, looks like it's not fixed yet, since ProjectModel.getAllFiles() directly modifies the result array that _getAllFilesCache() hands back, affecting the value all future calls will see.
Invoking
ProjectManager.getAllFiles()
(or more explicitly,ProjectManager.getAllFiles(null, false)
) often yields an array that includes files outside the project that are open in the working set. This happens any time someone has calledProjectManager.getAllFiles(true)
earlier.Most callers supposedly don't want working-set entries that are outside the project -- only Find in Files & Quick Open pass
true
. But since this bug has existed seemingly since Sprint 36 (a7a551d), those callers have been getting project-external items in the result list anyway. So presumably this doesn't cause any major ill effects for most callers.This happens because getAllFiles() reuses a cached result, and when
includeWorkingSet
is true it modifies the cache in-place to include the extra files. It should make a copy instead to prevent tainting the cache used by future callers.The text was updated successfully, but these errors were encountered: