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

Side by Side Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1408393007: Possible fix for a null-pointer problem (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 analyzer.src.context.context; 5 library analyzer.src.context.context;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/instrumentation/instrumentation.dart'; 10 import 'package:analyzer/instrumentation/instrumentation.dart';
(...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 } 1510 }
1511 } 1511 }
1512 return entries; 1512 return entries;
1513 } 1513 }
1514 1514
1515 void _evaluatePendingFutures() { 1515 void _evaluatePendingFutures() {
1516 for (AnalysisTarget target in _pendingFutureTargets.keys) { 1516 for (AnalysisTarget target in _pendingFutureTargets.keys) {
1517 CacheEntry cacheEntry = _cache.get(target); 1517 CacheEntry cacheEntry = _cache.get(target);
1518 List<PendingFuture> pendingFutures = _pendingFutureTargets[target]; 1518 List<PendingFuture> pendingFutures = _pendingFutureTargets[target];
1519 for (int i = 0; i < pendingFutures.length;) { 1519 for (int i = 0; i < pendingFutures.length;) {
1520 if (pendingFutures[i].evaluate(cacheEntry)) { 1520 if (cacheEntry == null) {
1521 pendingFutures[i].forciblyComplete();
Paul Berry 2015/10/21 17:57:34 After this line, add: pendingFutures.removeAt(i);
Brian Wilkerson 2015/10/21 18:05:01 Good catch! Done.
Leaf 2015/10/21 18:15:47 This is the same location that I was generally see
1522 } else if (pendingFutures[i].evaluate(cacheEntry)) {
1521 pendingFutures.removeAt(i); 1523 pendingFutures.removeAt(i);
1522 } else { 1524 } else {
1523 i++; 1525 i++;
1524 } 1526 }
1525 } 1527 }
1526 } 1528 }
1527 } 1529 }
1528 1530
1529 /** 1531 /**
1530 * Return a list containing all of the change notices that are waiting to be 1532 * Return a list containing all of the change notices that are waiting to be
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 new PendingFuture<T>(_context, target, computeValue); 2115 new PendingFuture<T>(_context, target, computeValue);
2114 if (!pendingFuture.evaluate(entry)) { 2116 if (!pendingFuture.evaluate(entry)) {
2115 _context._pendingFutureTargets 2117 _context._pendingFutureTargets
2116 .putIfAbsent(target, () => <PendingFuture>[]) 2118 .putIfAbsent(target, () => <PendingFuture>[])
2117 .add(pendingFuture); 2119 .add(pendingFuture);
2118 scheduleComputation(); 2120 scheduleComputation();
2119 } 2121 }
2120 return pendingFuture.future; 2122 return pendingFuture.future;
2121 } 2123 }
2122 } 2124 }
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