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

Side by Side Diff: pkg/analyzer/lib/src/generated/source.dart

Issue 687663002: More code clean-up (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | « pkg/analyzer/lib/src/generated/java_io.dart ('k') | 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.source; 8 library engine.source;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 * @param source the source whose contents are being overridden 64 * @param source the source whose contents are being overridden
65 * @param contents the new contents of the source 65 * @param contents the new contents of the source
66 * @return the original cached contents or `null` if none 66 * @return the original cached contents or `null` if none
67 */ 67 */
68 String setContents(Source source, String contents) { 68 String setContents(Source source, String contents) {
69 if (contents == null) { 69 if (contents == null) {
70 _stampMap.remove(source); 70 _stampMap.remove(source);
71 return _contentMap.remove(source); 71 return _contentMap.remove(source);
72 } else { 72 } else {
73 int newStamp = JavaSystem.currentTimeMillis(); 73 int newStamp = JavaSystem.currentTimeMillis();
74 int oldStamp = javaMapPut(_stampMap, source, newStamp); 74 int oldStamp = _stampMap[source];
75 // Occasionally, if this method is called in rapid succession, the timesta mps are equal. 75 _stampMap[source] = newStamp;
76 // Guard against this by artificially incrementing the new timestamp 76 // Occasionally, if this method is called in rapid succession, the
77 // timestamps are equal. Guard against this by artificially incrementing
78 // the new timestamp.
77 if (newStamp == oldStamp) { 79 if (newStamp == oldStamp) {
78 _stampMap[source] = newStamp + 1; 80 _stampMap[source] = newStamp + 1;
79 } 81 }
80 return javaMapPut(_contentMap, source, contents); 82 String oldContent =_contentMap[source];
83 _contentMap[source] = contents;
84 return oldContent;
81 } 85 }
82 } 86 }
83 } 87 }
84 88
85 /** 89 /**
86 * Instances of the class `DartUriResolver` resolve `dart` URI's. 90 * Instances of the class `DartUriResolver` resolve `dart` URI's.
87 */ 91 */
88 class DartUriResolver extends UriResolver { 92 class DartUriResolver extends UriResolver {
89 /** 93 /**
90 * Return `true` if the given URI is a `dart-ext:` URI. 94 * Return `true` if the given URI is a `dart-ext:` URI.
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 908
905 /** 909 /**
906 * Return an absolute URI that represents the given source, or `null` if a val id URI cannot 910 * Return an absolute URI that represents the given source, or `null` if a val id URI cannot
907 * be computed. 911 * be computed.
908 * 912 *
909 * @param source the source to get URI for 913 * @param source the source to get URI for
910 * @return the absolute URI representing the given source 914 * @return the absolute URI representing the given source
911 */ 915 */
912 Uri restoreAbsolute(Source source) => null; 916 Uri restoreAbsolute(Source source) => null;
913 } 917 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/java_io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698