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

Side by Side Diff: pkg/analyzer_experimental/lib/src/generated/source_io.dart

Issue 14161021: Generate unique names less aggressively. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
OLDNEW
1 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 3
4 library engine.source.io; 4 library engine.source.io;
5 5
6 import 'source.dart'; 6 import 'source.dart';
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:uri'; 8 import 'dart:uri';
9 import 'java_core.dart'; 9 import 'java_core.dart';
10 import 'java_io.dart'; 10 import 'java_io.dart';
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 _jtd_constructor_328_impl(ContentCache contentCache, JavaFile file) { 46 _jtd_constructor_328_impl(ContentCache contentCache, JavaFile file) {
47 _jtd_constructor_329_impl(contentCache, file, false); 47 _jtd_constructor_329_impl(contentCache, file, false);
48 } 48 }
49 /** 49 /**
50 * Initialize a newly created source object. 50 * Initialize a newly created source object.
51 * @param contentCache the content cache used to access the contents of this s ource 51 * @param contentCache the content cache used to access the contents of this s ource
52 * @param file the file represented by this source 52 * @param file the file represented by this source
53 * @param inSystemLibrary {@code true} if this source is in one of the system libraries 53 * @param inSystemLibrary {@code true} if this source is in one of the system libraries
54 */ 54 */
55 FileBasedSource.con2(ContentCache contentCache2, JavaFile file3, bool inSystem Library2) { 55 FileBasedSource.con2(ContentCache contentCache2, JavaFile file2, bool inSystem Library2) {
56 _jtd_constructor_329_impl(contentCache2, file3, inSystemLibrary2); 56 _jtd_constructor_329_impl(contentCache2, file2, inSystemLibrary2);
57 } 57 }
58 _jtd_constructor_329_impl(ContentCache contentCache2, JavaFile file3, bool inS ystemLibrary2) { 58 _jtd_constructor_329_impl(ContentCache contentCache2, JavaFile file2, bool inS ystemLibrary2) {
59 this._contentCache = contentCache2; 59 this._contentCache = contentCache2;
60 this._file = file3; 60 this._file = file2;
61 this._inSystemLibrary = inSystemLibrary2; 61 this._inSystemLibrary = inSystemLibrary2;
62 this._fileUriString = file3.toURI().toString(); 62 this._fileUriString = file2.toURI().toString();
63 } 63 }
64 bool operator ==(Object object) => object != null && this.runtimeType == objec t.runtimeType && _file == ((object as FileBasedSource))._file; 64 bool operator ==(Object object) => object != null && this.runtimeType == objec t.runtimeType && _file == ((object as FileBasedSource))._file;
65 bool exists() => _contentCache.getContents(this) != null || (_file.exists() && !_file.isDirectory()); 65 bool exists() => _contentCache.getContents(this) != null || (_file.exists() && !_file.isDirectory());
66 void getContents(Source_ContentReceiver receiver) { 66 void getContents(Source_ContentReceiver receiver) {
67 { 67 {
68 String contents = _contentCache.getContents(this); 68 String contents = _contentCache.getContents(this);
69 if (contents != null) { 69 if (contents != null) {
70 receiver.accept2(contents, _contentCache.getModificationStamp(this)); 70 receiver.accept2(contents, _contentCache.getModificationStamp(this));
71 return; 71 return;
72 } 72 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 PackageUriResolver(List<JavaFile> packagesDirectories) { 139 PackageUriResolver(List<JavaFile> packagesDirectories) {
140 if (packagesDirectories.length < 1) { 140 if (packagesDirectories.length < 1) {
141 throw new IllegalArgumentException("At least one package directory must be provided"); 141 throw new IllegalArgumentException("At least one package directory must be provided");
142 } 142 }
143 this._packagesDirectories = packagesDirectories; 143 this._packagesDirectories = packagesDirectories;
144 } 144 }
145 Source resolveAbsolute(ContentCache contentCache, Uri uri) { 145 Source resolveAbsolute(ContentCache contentCache, Uri uri) {
146 if (!isPackageUri(uri)) { 146 if (!isPackageUri(uri)) {
147 return null; 147 return null;
148 } 148 }
149 String path4 = uri.path; 149 String path2 = uri.path;
150 if (path4 == null) { 150 if (path2 == null) {
151 path4 = uri.path; 151 path2 = uri.path;
152 if (path4 == null) { 152 if (path2 == null) {
153 return null; 153 return null;
154 } 154 }
155 } 155 }
156 String pkgName; 156 String pkgName;
157 String relPath; 157 String relPath;
158 int index = path4.indexOf('/'); 158 int index = path2.indexOf('/');
159 if (index == -1) { 159 if (index == -1) {
160 pkgName = path4; 160 pkgName = path2;
161 relPath = ""; 161 relPath = "";
162 } else if (index == 0) { 162 } else if (index == 0) {
163 return null; 163 return null;
164 } else { 164 } else {
165 pkgName = path4.substring(0, index); 165 pkgName = path2.substring(0, index);
166 relPath = path4.substring(index + 1); 166 relPath = path2.substring(index + 1);
167 } 167 }
168 for (JavaFile packagesDirectory in _packagesDirectories) { 168 for (JavaFile packagesDirectory in _packagesDirectories) {
169 JavaFile resolvedFile = new JavaFile.relative(packagesDirectory, path4); 169 JavaFile resolvedFile = new JavaFile.relative(packagesDirectory, path2);
170 if (resolvedFile.exists()) { 170 if (resolvedFile.exists()) {
171 return new FileBasedSource.con1(contentCache, getCanonicalFile(packagesD irectory, pkgName, relPath)); 171 return new FileBasedSource.con1(contentCache, getCanonicalFile(packagesD irectory, pkgName, relPath));
172 } 172 }
173 } 173 }
174 return new FileBasedSource.con1(contentCache, getCanonicalFile(_packagesDire ctories[0], pkgName, relPath)); 174 return new FileBasedSource.con1(contentCache, getCanonicalFile(_packagesDire ctories[0], pkgName, relPath));
175 } 175 }
176 /** 176 /**
177 * Answer the canonical file for the specified package. 177 * Answer the canonical file for the specified package.
178 * @param packagesDirectory the "packages" directory (not {@code null}) 178 * @param packagesDirectory the "packages" directory (not {@code null})
179 * @param pkgName the package name (not {@code null}, not empty) 179 * @param pkgName the package name (not {@code null}, not empty)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 DirectoryBasedSourceContainer.con1(JavaFile directory) { 221 DirectoryBasedSourceContainer.con1(JavaFile directory) {
222 _jtd_constructor_326_impl(directory); 222 _jtd_constructor_326_impl(directory);
223 } 223 }
224 _jtd_constructor_326_impl(JavaFile directory) { 224 _jtd_constructor_326_impl(JavaFile directory) {
225 _jtd_constructor_327_impl(directory.getPath()); 225 _jtd_constructor_327_impl(directory.getPath());
226 } 226 }
227 /** 227 /**
228 * Construct a container representing the specified path and containing any so urces whose{@link Source#getFullName()} starts with the specified path. 228 * Construct a container representing the specified path and containing any so urces whose{@link Source#getFullName()} starts with the specified path.
229 * @param path the path (not {@code null} and not empty) 229 * @param path the path (not {@code null} and not empty)
230 */ 230 */
231 DirectoryBasedSourceContainer.con2(String path3) { 231 DirectoryBasedSourceContainer.con2(String path2) {
232 _jtd_constructor_327_impl(path3); 232 _jtd_constructor_327_impl(path2);
233 } 233 }
234 _jtd_constructor_327_impl(String path3) { 234 _jtd_constructor_327_impl(String path2) {
235 this._path = appendFileSeparator(path3); 235 this._path = appendFileSeparator(path2);
236 } 236 }
237 bool contains(Source source) => source.fullName.startsWith(_path); 237 bool contains(Source source) => source.fullName.startsWith(_path);
238 bool operator ==(Object obj) => (obj is DirectoryBasedSourceContainer) && ((ob j as DirectoryBasedSourceContainer)).path == path; 238 bool operator ==(Object obj) => (obj is DirectoryBasedSourceContainer) && ((ob j as DirectoryBasedSourceContainer)).path == path;
239 /** 239 /**
240 * Answer the receiver's path, used to determine if a source is contained in t he receiver. 240 * Answer the receiver's path, used to determine if a source is contained in t he receiver.
241 * @return the path (not {@code null}, not empty) 241 * @return the path (not {@code null}, not empty)
242 */ 242 */
243 String get path => _path; 243 String get path => _path;
244 int get hashCode => _path.hashCode; 244 int get hashCode => _path.hashCode;
245 } 245 }
(...skipping 18 matching lines...) Expand all
264 */ 264 */
265 FileUriResolver() : super() { 265 FileUriResolver() : super() {
266 } 266 }
267 Source resolveAbsolute(ContentCache contentCache, Uri uri) { 267 Source resolveAbsolute(ContentCache contentCache, Uri uri) {
268 if (!isFileUri(uri)) { 268 if (!isFileUri(uri)) {
269 return null; 269 return null;
270 } 270 }
271 return new FileBasedSource.con1(contentCache, new JavaFile.fromUri(uri)); 271 return new FileBasedSource.con1(contentCache, new JavaFile.fromUri(uri));
272 } 272 }
273 } 273 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698