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

Side by Side Diff: utils/pub/root_source.dart

Issue 11235054: Removed IllegalAccessException and UnsupportedOperationException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 root_source; 5 library root_source;
6 6
7 import 'package.dart'; 7 import 'package.dart';
8 import 'pubspec.dart'; 8 import 'pubspec.dart';
9 import 'source.dart'; 9 import 'source.dart';
10 10
11 /** 11 /**
12 * A source used only for the root package when doing version resolution. It 12 * A source used only for the root package when doing version resolution. It
13 * contains only the root package and is unable to install packages. 13 * contains only the root package and is unable to install packages.
14 * 14 *
15 * This source cannot be referenced from a pubspec. 15 * This source cannot be referenced from a pubspec.
16 */ 16 */
17 class RootSource extends Source { 17 class RootSource extends Source {
18 final String name = "root"; 18 final String name = "root";
19 final bool shouldCache = false; 19 final bool shouldCache = false;
20 final Package package; 20 final Package package;
21 21
22 RootSource(this.package); 22 RootSource(this.package);
23 23
24 Future<Pubspec> describe(PackageId id) { 24 Future<Pubspec> describe(PackageId id) {
25 return new Future<Pubspec>.immediate(package.pubspec); 25 return new Future<Pubspec>.immediate(package.pubspec);
26 } 26 }
27 27
28 Future<bool> install(PackageId id, String destPath) { 28 Future<bool> install(PackageId id, String destPath) {
29 throw new UnsupportedOperationException( 29 throw new StateError(
floitsch 2012/10/23 12:50:32 one line.
Lasse Reichstein Nielsen 2012/10/24 12:32:15 Done.
30 "Can't install from a root source."); 30 "Can't install from a root source.");
31 } 31 }
32 } 32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698