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

Unified Diff: utils/pub/package.dart

Issue 12288040: Reapply "Make Comparable generic." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix problems. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/css/source.dart ('k') | utils/pub/version.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/package.dart
diff --git a/utils/pub/package.dart b/utils/pub/package.dart
index dd988cb61efd79bfb03a3b15356adb879ccc1ca0..87316550a3b1c9622e238c4c30ba639623bbe359 100644
--- a/utils/pub/package.dart
+++ b/utils/pub/package.dart
@@ -85,7 +85,7 @@ class Package {
/// different directories that happen to contain identical packages. For
/// example, the same package may be available from multiple sources. As far as
/// Pub is concerned, those packages are different.
-class PackageId implements Comparable {
+class PackageId implements Comparable<PackageId> {
/// The name of the package being identified.
final String name;
@@ -129,9 +129,7 @@ class PackageId implements Comparable {
return "$name $version from $source";
}
- int compareTo(Comparable other) {
- if (other is! PackageId) throw new ArgumentError(other);
-
+ int compareTo(PackageId other) {
var sourceComp = source.name.compareTo(other.source.name);
if (sourceComp != 0) return sourceComp;
« no previous file with comments | « utils/css/source.dart ('k') | utils/pub/version.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698