Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 988533002: Guard against exception when accessing folder (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library context.directory.manager; 5 library context.directory.manager;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analysis_server/src/analysis_server.dart'; 10 import 'package:analysis_server/src/analysis_server.dart';
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 Folder contextFolder, UriResolver packageUriResolver); 252 Folder contextFolder, UriResolver packageUriResolver);
253 253
254 /** 254 /**
255 * Resursively adds all Dart and HTML files to the [changeSet]. 255 * Resursively adds all Dart and HTML files to the [changeSet].
256 */ 256 */
257 void _addPreviouslyExcludedSources(_ContextInfo info, ChangeSet changeSet, 257 void _addPreviouslyExcludedSources(_ContextInfo info, ChangeSet changeSet,
258 Folder folder, List<String> oldExcludedPaths) { 258 Folder folder, List<String> oldExcludedPaths) {
259 if (info.excludesResource(folder)) { 259 if (info.excludesResource(folder)) {
260 return; 260 return;
261 } 261 }
262 List<Resource> children = folder.getChildren(); 262 List<Resource> children;
263 try {
264 children = folder.getChildren();
265 } on FileSystemException catch (exception) {
266 // The folder no longer exists, or cannot be read, to there's nothing to
267 // do.
268 return;
269 }
263 for (Resource child in children) { 270 for (Resource child in children) {
264 String path = child.path; 271 String path = child.path;
265 // add files, recurse into folders 272 // add files, recurse into folders
266 if (child is File) { 273 if (child is File) {
267 // ignore if should not be analyzed at all 274 // ignore if should not be analyzed at all
268 if (!_shouldFileBeAnalyzed(child)) { 275 if (!_shouldFileBeAnalyzed(child)) {
269 continue; 276 continue;
270 } 277 }
271 // ignore if was not excluded 278 // ignore if was not excluded
272 bool wasExcluded = _isExcludedBy(oldExcludedPaths, path) && 279 bool wasExcluded = _isExcludedBy(oldExcludedPaths, path) &&
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 return excludes(resource.path); 710 return excludes(resource.path);
704 } 711 }
705 712
706 /** 713 /**
707 * Returns `true` if [path] is the pubspec file of this context. 714 * Returns `true` if [path] is the pubspec file of this context.
708 */ 715 */
709 bool isPubspec(String path) { 716 bool isPubspec(String path) {
710 return path == pubspecPath; 717 return path == pubspecPath;
711 } 718 }
712 } 719 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698