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

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

Issue 1515533004: Clean up syntax in generic method comments (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | pkg/analyzer/lib/src/context/context.dart » ('j') | 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.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/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
(...skipping 22 matching lines...) Expand all
33 * An array containing the partitions of which this cache is comprised. 33 * An array containing the partitions of which this cache is comprised.
34 */ 34 */
35 final List<CachePartition> _partitions; 35 final List<CachePartition> _partitions;
36 36
37 /** 37 /**
38 * The [StreamController] reporting [InvalidatedResult]s. 38 * The [StreamController] reporting [InvalidatedResult]s.
39 */ 39 */
40 final ReentrantSynchronousStream<InvalidatedResult> onResultInvalidated = 40 final ReentrantSynchronousStream<InvalidatedResult> onResultInvalidated =
41 new ReentrantSynchronousStream<InvalidatedResult>(); 41 new ReentrantSynchronousStream<InvalidatedResult>();
42 42
43 final List< 43 final List<ReentrantSynchronousStreamSubscription>
44 ReentrantSynchronousStreamSubscription> onResultInvalidatedPartitionSubscr iptions = < 44 onResultInvalidatedPartitionSubscriptions =
45 ReentrantSynchronousStreamSubscription>[]; 45 <ReentrantSynchronousStreamSubscription>[];
46 46
47 /** 47 /**
48 * Initialize a newly created cache to have the given [_partitions]. The 48 * Initialize a newly created cache to have the given [_partitions]. The
49 * partitions will be searched in the order in which they appear in the array, 49 * partitions will be searched in the order in which they appear in the array,
50 * so the most specific partition (usually an [SdkCachePartition]) should be 50 * so the most specific partition (usually an [SdkCachePartition]) should be
51 * first and the most general (usually a [UniversalCachePartition]) last. 51 * first and the most general (usually a [UniversalCachePartition]) last.
52 */ 52 */
53 AnalysisCache(this._partitions) { 53 AnalysisCache(this._partitions) {
54 for (CachePartition partition in _partitions) { 54 for (CachePartition partition in _partitions) {
55 ReentrantSynchronousStreamSubscription<InvalidatedResult> subscription = 55 ReentrantSynchronousStreamSubscription<InvalidatedResult> subscription =
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 if (data == null) { 377 if (data == null) {
378 return CacheState.INVALID; 378 return CacheState.INVALID;
379 } 379 }
380 return data.state; 380 return data.state;
381 } 381 }
382 382
383 /** 383 /**
384 * Return the value of the result represented by the given [descriptor], or 384 * Return the value of the result represented by the given [descriptor], or
385 * the default value for the result if this entry does not have a valid value. 385 * the default value for the result if this entry does not have a valid value.
386 */ 386 */
387 /*<V>*/ dynamic /*V*/ getValue(ResultDescriptor /*<V>*/ descriptor) { 387 dynamic /*=V*/ getValue /*<V>*/ (ResultDescriptor /*<V>*/ descriptor) {
388 ResultData data = _resultMap[descriptor]; 388 ResultData data = _resultMap[descriptor];
389 if (data == null) { 389 if (data == null) {
390 return descriptor.defaultValue; 390 return descriptor.defaultValue;
391 } 391 }
392 if (_partition != null) { 392 if (_partition != null) {
393 _partition.resultAccessed(target, descriptor); 393 _partition.resultAccessed(target, descriptor);
394 } 394 }
395 return data.value; 395 return data.value;
396 } 396 }
397 397
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 // 475 //
476 data.value = descriptor.defaultValue; 476 data.value = descriptor.defaultValue;
477 } 477 }
478 } 478 }
479 } 479 }
480 480
481 /** 481 /**
482 * Set the value of the result represented by the given [descriptor] to the 482 * Set the value of the result represented by the given [descriptor] to the
483 * given [value]. 483 * given [value].
484 */ 484 */
485 /*<V>*/ void setValue( 485 void setValue /*<V>*/ (ResultDescriptor /*<V>*/ descriptor,
486 ResultDescriptor /*<V>*/ descriptor, 486 dynamic /*=V*/ value, List<TargetedResult> dependedOn) {
487 dynamic /*V*/
488 value,
489 List<TargetedResult> dependedOn) {
490 // { 487 // {
491 // String valueStr = '$value'; 488 // String valueStr = '$value';
492 // if (valueStr.length > 20) { 489 // if (valueStr.length > 20) {
493 // valueStr = valueStr.substring(0, 20) + '...'; 490 // valueStr = valueStr.substring(0, 20) + '...';
494 // } 491 // }
495 // valueStr = valueStr.replaceAll('\n', '\\n'); 492 // valueStr = valueStr.replaceAll('\n', '\\n');
496 // print( 493 // print(
497 // 'setValue $descriptor for $target value=$valueStr $dependedOn=$depen dedOn'); 494 // 'setValue $descriptor for $target value=$valueStr $dependedOn=$depen dedOn');
498 // } 495 // }
499 _validateStateChange(descriptor, CacheState.VALID); 496 _validateStateChange(descriptor, CacheState.VALID);
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 void resultAccessed(TargetedResult result) {} 1252 void resultAccessed(TargetedResult result) {}
1256 1253
1257 @override 1254 @override
1258 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { 1255 List<TargetedResult> resultStored(TargetedResult newResult, newValue) {
1259 return TargetedResult.EMPTY_LIST; 1256 return TargetedResult.EMPTY_LIST;
1260 } 1257 }
1261 1258
1262 @override 1259 @override
1263 void targetRemoved(AnalysisTarget target) {} 1260 void targetRemoved(AnalysisTarget target) {}
1264 } 1261 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/context/context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698