| OLD | NEW |
| 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.cache; | 5 library analyzer.src.context.cache; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/dart/element/element.dart' | 10 import 'package:analyzer/src/dart/element/element.dart' |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 * the default value for the result if this entry does not have a valid value. | 398 * the default value for the result if this entry does not have a valid value. |
| 399 */ | 399 */ |
| 400 dynamic/*=V*/ getValue/*<V>*/(ResultDescriptor/*<V>*/ descriptor) { | 400 dynamic/*=V*/ getValue/*<V>*/(ResultDescriptor/*<V>*/ descriptor) { |
| 401 ResultData data = _resultMap[descriptor]; | 401 ResultData data = _resultMap[descriptor]; |
| 402 if (data == null) { | 402 if (data == null) { |
| 403 return descriptor.defaultValue; | 403 return descriptor.defaultValue; |
| 404 } | 404 } |
| 405 if (_partition != null) { | 405 if (_partition != null) { |
| 406 _partition.resultAccessed(target, descriptor); | 406 _partition.resultAccessed(target, descriptor); |
| 407 } | 407 } |
| 408 return data.value; | 408 return data.value as Object/*=V*/; |
| 409 } | 409 } |
| 410 | 410 |
| 411 /** | 411 /** |
| 412 * Return `true` if the state of any data value is [CacheState.ERROR]. | 412 * Return `true` if the state of any data value is [CacheState.ERROR]. |
| 413 */ | 413 */ |
| 414 bool hasErrorState() { | 414 bool hasErrorState() { |
| 415 for (ResultData data in _resultMap.values) { | 415 for (ResultData data in _resultMap.values) { |
| 416 if (data.state == CacheState.ERROR) { | 416 if (data.state == CacheState.ERROR) { |
| 417 return true; | 417 return true; |
| 418 } | 418 } |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1269 void resultAccessed(TargetedResult result) {} | 1269 void resultAccessed(TargetedResult result) {} |
| 1270 | 1270 |
| 1271 @override | 1271 @override |
| 1272 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { | 1272 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { |
| 1273 return TargetedResult.EMPTY_LIST; | 1273 return TargetedResult.EMPTY_LIST; |
| 1274 } | 1274 } |
| 1275 | 1275 |
| 1276 @override | 1276 @override |
| 1277 void targetRemoved(AnalysisTarget target) {} | 1277 void targetRemoved(AnalysisTarget target) {} |
| 1278 } | 1278 } |
| OLD | NEW |