Files
sdk/pkg/analyzer/lib
Konstantin Shcheglov f7ef66f5b0 Issue 33412. Fix for race condition in knownFiles during search.
In theory discoverAvailableFiles() should wait for all possibly known
files to be discovered. But I think it is still possible to get the
set of known files changed, e.g. when are asking asynchronoiusly for
getIndex() and the user open a file that is not yet part of any driver.

Only the second hunk of the change (inside subtypes()) is required for fixing
the issue, the crucial change is toList() invocation. The switch from
_driver.knownFiles to _driver.fsState.knownFiles is done to avoid one extra
lookup for FileState.

The first hunk (inside declarations()) is done just for consistency.


Fixes https://github.com/dart-lang/sdk/issues/33412

R=paulberry@google.com

Change-Id: I652ef7a156eba4bf0298c7e863dcef2b7c9f2b0e
Reviewed-on: https://dart-review.googlesource.com/60142
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-06-13 21:49:14 +00:00
..