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

Side by Side Diff: pkg/analyzer/lib/file_system/memory_file_system.dart

Issue 2050083002: Fix equality between subclasses of Source (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
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 library analyzer.file_system.memory_file_system; 5 library analyzer.file_system.memory_file_system;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:core' hide Resource; 9 import 'dart:core' hide Resource;
10 10
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 } else if (scheme == DartUriResolver.DART_SCHEME) { 442 } else if (scheme == DartUriResolver.DART_SCHEME) {
443 return UriKind.DART_URI; 443 return UriKind.DART_URI;
444 } else if (scheme == FileUriResolver.FILE_SCHEME) { 444 } else if (scheme == FileUriResolver.FILE_SCHEME) {
445 return UriKind.FILE_URI; 445 return UriKind.FILE_URI;
446 } 446 }
447 return UriKind.FILE_URI; 447 return UriKind.FILE_URI;
448 } 448 }
449 449
450 @override 450 @override
451 bool operator ==(other) { 451 bool operator ==(other) {
452 return other is _MemoryFileSource && other.id == id; 452 if (other is _MemoryFileSource) {
453 return id == other.id;
454 } else if (other is Source) {
455 return uri == other.uri;
456 }
457 return false;
453 } 458 }
454 459
455 @override 460 @override
456 bool exists() => file.exists; 461 bool exists() => file.exists;
457 462
458 @override 463 @override
459 String toString() => file.toString(); 464 String toString() => file.toString();
460 } 465 }
461 466
462 /** 467 /**
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 bool operator ==(other) { 575 bool operator ==(other) {
571 if (runtimeType != other.runtimeType) { 576 if (runtimeType != other.runtimeType) {
572 return false; 577 return false;
573 } 578 }
574 return path == other.path; 579 return path == other.path;
575 } 580 }
576 581
577 @override 582 @override
578 String toString() => path; 583 String toString() => path;
579 } 584 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/services/completion/dart/optype_test.dart ('k') | pkg/analyzer/lib/src/generated/source_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698