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

Unified Diff: pkg/collection/lib/src/unmodifiable_wrappers.dart

Issue 308653004: Fix analyzer hints in pkg/collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 7 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 | « pkg/collection/CHANGELOG.md ('k') | pkg/collection/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/collection/lib/src/unmodifiable_wrappers.dart
diff --git a/pkg/collection/lib/src/unmodifiable_wrappers.dart b/pkg/collection/lib/src/unmodifiable_wrappers.dart
index 022bbfe17427fb68e25e2cc57f7c0302df30c5ce..72b189cf3f8a6484b4b881b254ec18657b7c3292 100644
--- a/pkg/collection/lib/src/unmodifiable_wrappers.dart
+++ b/pkg/collection/lib/src/unmodifiable_wrappers.dart
@@ -36,7 +36,7 @@ class NonGrowableListView<E> extends DelegatingList<E>
* change the List's length.
*/
abstract class NonGrowableListMixin<E> implements List<E> {
- static void _throw() {
+ static _throw() {
throw new UnsupportedError(
"Cannot change the length of a fixed-length list");
}
@@ -51,9 +51,7 @@ abstract class NonGrowableListMixin<E> implements List<E> {
* Throws an [UnsupportedError];
* operations that change the length of the list are disallowed.
*/
- bool add(E value) {
- _throw();
- }
+ bool add(E value) => _throw();
/**
* Throws an [UnsupportedError];
@@ -77,19 +75,19 @@ abstract class NonGrowableListMixin<E> implements List<E> {
* Throws an [UnsupportedError];
* operations that change the length of the list are disallowed.
*/
- bool remove(Object value) { _throw(); }
+ bool remove(Object value) => _throw();
/**
* Throws an [UnsupportedError];
* operations that change the length of the list are disallowed.
*/
- E removeAt(int index) { _throw(); }
+ E removeAt(int index) => _throw();
/**
* Throws an [UnsupportedError];
* operations that change the length of the list are disallowed.
*/
- E removeLast() { _throw(); }
+ E removeLast() => _throw();
/**
* Throws an [UnsupportedError];
@@ -141,7 +139,7 @@ class UnmodifiableSetView<E> extends DelegatingSet<E>
* change the Set.
*/
abstract class UnmodifiableSetMixin<E> implements Set<E> {
- void _throw() {
+ _throw() {
throw new UnsupportedError("Cannot modify an unmodifiable Set");
}
@@ -149,9 +147,7 @@ abstract class UnmodifiableSetMixin<E> implements Set<E> {
* Throws an [UnsupportedError];
* operations that change the set are disallowed.
*/
- bool add(E value) {
- _throw();
- }
+ bool add(E value) => _throw();
/**
* Throws an [UnsupportedError];
@@ -163,7 +159,7 @@ abstract class UnmodifiableSetMixin<E> implements Set<E> {
* Throws an [UnsupportedError];
* operations that change the set are disallowed.
*/
- bool remove(Object value) { _throw(); }
+ bool remove(Object value) => _throw();
/**
* Throws an [UnsupportedError];
@@ -215,7 +211,7 @@ class UnmodifiableMapView<K, V> extends DelegatingMap<K, V>
* change the Map.
*/
abstract class UnmodifiableMapMixin<K, V> implements Map<K, V> {
- static void _throw() {
+ static _throw() {
throw new UnsupportedError("Cannot modify an unmodifiable Map");
}
@@ -229,7 +225,7 @@ abstract class UnmodifiableMapMixin<K, V> implements Map<K, V> {
* Throws an [UnsupportedError];
* operations that change the map are disallowed.
*/
- V putIfAbsent(K key, V ifAbsent()) { _throw(); }
+ V putIfAbsent(K key, V ifAbsent()) => _throw();
/**
* Throws an [UnsupportedError];
@@ -241,7 +237,7 @@ abstract class UnmodifiableMapMixin<K, V> implements Map<K, V> {
* Throws an [UnsupportedError];
* operations that change the map are disallowed.
*/
- V remove(K key) { _throw(); }
+ V remove(K key) => _throw();
/**
* Throws an [UnsupportedError];
« no previous file with comments | « pkg/collection/CHANGELOG.md ('k') | pkg/collection/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698