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

Unified Diff: pkg/analyzer_experimental/lib/src/generated/java_core.dart

Issue 14173003: Remove Collection, Collections and clean up List/Set/Queue implementations of retain/remove. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/element.dart ('k') | pkg/args/lib/args.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_experimental/lib/src/generated/java_core.dart
diff --git a/pkg/analyzer_experimental/lib/src/generated/java_core.dart b/pkg/analyzer_experimental/lib/src/generated/java_core.dart
index 900c2ca7093040a5dcb0a186381e0bfcbefaf939..798d9e4fbd41ac2347d6f8ba033fb16a59955e33 100644
--- a/pkg/analyzer_experimental/lib/src/generated/java_core.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/java_core.dart
@@ -2,6 +2,7 @@ library java.core;
import "dart:math" as math;
import "dart:uri";
+import "dart:collection" show ListBase;
class JavaSystem {
static int currentTimeMillis() {
@@ -257,7 +258,7 @@ class IOException implements Exception {
String toString() => "IOException";
}
-class ListWrapper<E> extends Collection<E> implements List<E> {
+class ListWrapper<E> extends ListBase<E> implements List<E> {
List<E> elements = new List<E>();
Iterator<E> get iterator {
@@ -344,13 +345,13 @@ class ListWrapper<E> extends Collection<E> implements List<E> {
}
class JavaIterator<E> {
- Collection<E> _collection;
+ Iterable<E> _iterable;
List<E> _elements = new List<E>();
int _coPos = 0;
int _elPos = 0;
E _current = null;
- JavaIterator(this._collection) {
- Iterator iterator = _collection.iterator;
+ JavaIterator(this._iterable) {
+ Iterator iterator = _iterable.iterator;
while (iterator.moveNext()) {
_elements.add(iterator.current);
}
@@ -368,13 +369,13 @@ class JavaIterator<E> {
}
void remove() {
- if (_collection is List) {
+ if (_iterable is List) {
_coPos--;
- (_collection as List).remove(_coPos);
- } else if (_collection is Set) {
- _collection.remove(_current);
+ (_iterable as List).remove(_coPos);
+ } else if (_iterable is Set) {
+ _iterable.remove(_current);
} else {
- throw new StateError("Unsupported collection ${_collection.runtimeType}");
+ throw new StateError("Unsupported iterable ${_iterable.runtimeType}");
}
}
}
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/element.dart ('k') | pkg/args/lib/args.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698