3 cleanup commits (#31)

* Remove codereview.settings

* Test on oldest supported Dart SDK

* Enable and fix a number of lints
diff --git a/.travis.yml b/.travis.yml
index 910f2fa..90eeb66 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,11 +1,17 @@
 language: dart
 dart:
+  - stable
   - dev
 
 dart_task:
   - test
-  - dartfmt
-  - dartanalyzer
+  - dartanalyzer: --fatal-infos --fatal-warnings .
+
+matrix:
+  include:
+  # Only validate formatting using the dev release
+  - dart: dev
+    dart_task: dartfmt
 
 # Only building master means that we don't run two builds for each pull request.
 branches:
diff --git a/analysis_options.yaml b/analysis_options.yaml
new file mode 100644
index 0000000..3c4fd78
--- /dev/null
+++ b/analysis_options.yaml
@@ -0,0 +1,43 @@
+include: package:pedantic/analysis_options.yaml
+#analyzer:
+#  strong-mode:
+#    implicit-casts: false
+linter:
+  rules:
+    - avoid_empty_else
+    - avoid_init_to_null
+    - avoid_null_checks_in_equality_operators
+    - avoid_unused_constructor_parameters
+    - await_only_futures
+    - camel_case_types
+    - cancel_subscriptions
+    - constant_identifier_names
+    - control_flow_in_finally
+    - directives_ordering
+    - empty_catches
+    - empty_constructor_bodies
+    - empty_statements
+    - hash_and_equals
+    - implementation_imports
+    - iterable_contains_unrelated_type
+    - library_names
+    - library_prefixes
+    - list_remove_unrelated_type
+    - non_constant_identifier_names
+    - overridden_fields
+    - package_api_docs
+    - package_names
+    - package_prefixed_library_names
+    - prefer_equal_for_default_values
+    - prefer_final_fields
+    - prefer_generic_function_type_aliases
+    - prefer_is_not_empty
+    - slash_for_doc_comments
+    - test_types_in_equals
+    - throw_in_finally
+    - type_init_formals
+    - unnecessary_brace_in_string_interps
+    - unnecessary_const
+    - unnecessary_new
+    - unrelated_type_equality_checks
+    - valid_regexps
diff --git a/codereview.settings b/codereview.settings
deleted file mode 100644
index ef6dc9c..0000000
--- a/codereview.settings
+++ /dev/null
@@ -1,3 +0,0 @@
-CODE_REVIEW_SERVER: https://codereview.chromium.org/
-VIEW_VC: https://github.com/dart-lang/isolate/commit/
-CC_LIST: reviews@dartlang.org
\ No newline at end of file
diff --git a/example/http_server.dart b/example/http_server.dart
index 7626e2a..0072d52 100644
--- a/example/http_server.dart
+++ b/example/http_server.dart
@@ -30,7 +30,7 @@
   await listener.start(server);
 
   return singleCallbackPort((SendPort resultPort) {
-    sendFutureResult(new Future.sync(listener.stop), resultPort);
+    sendFutureResult(Future.sync(listener.stop), resultPort);
   });
 }
 
@@ -49,7 +49,7 @@
 /// Returns the message content plus an ID describing the isolate that
 /// handled the request.
 class EchoHttpListener implements HttpListener {
-  static const _delay = const Duration(seconds: 2);
+  static const _delay = Duration(seconds: 2);
   static final _id = Isolate.current.hashCode;
   final SendPort _counter;
 
@@ -63,8 +63,10 @@
       await request.response.addStream(request);
       print("Request to $hashCode");
       request.response.write("#$_id\n");
-      var watch = new Stopwatch()..start();
-      while (watch.elapsed < _delay);
+      var watch = Stopwatch()..start();
+      while (watch.elapsed < _delay) {
+        await Future.delayed(const Duration(milliseconds: 100));
+      }
       print("Response from $_id");
       await request.response.close();
       _counter.send(null);
@@ -80,12 +82,12 @@
 
 main(List<String> args) async {
   int port = 0;
-  if (args.length > 0) {
+  if (args.isNotEmpty) {
     port = int.parse(args[0]);
   }
 
-  var counter = new ReceivePort();
-  HttpListener listener = new EchoHttpListener(counter.sendPort);
+  var counter = ReceivePort();
+  HttpListener listener = EchoHttpListener(counter.sendPort);
 
   // Used to ensure the requested port is available or to find an available
   // port if `0` is provided.
@@ -93,9 +95,8 @@
       await ServerSocket.bind(InternetAddress.anyIPv6, port, shared: true);
 
   port = socket.port;
-  var isolates =
-      await Future.wait(new Iterable.generate(5, (_) => IsolateRunner.spawn()),
-          cleanUp: (isolate) {
+  var isolates = await Future.wait(
+      Iterable.generate(5, (_) => IsolateRunner.spawn()), cleanUp: (isolate) {
     isolate.close();
   });
 
diff --git a/example/runner_pool.dart b/example/runner_pool.dart
index 25c85b8..3439f05 100644
--- a/example/runner_pool.dart
+++ b/example/runner_pool.dart
@@ -11,19 +11,19 @@
 
 void main() {
   int N = 44;
-  var sw = new Stopwatch()..start();
+  var sw = Stopwatch()..start();
   // Compute fib up to 42 with 4 isolates.
   parfib(N, 4).then((v1) {
     var t1 = sw.elapsedMilliseconds;
     sw.stop();
     sw.reset();
-    print("fib#4(${N}) = ${v1[N]}, ms: $t1");
+    print("fib#4($N) = ${v1[N]}, ms: $t1");
     sw.start();
     // Then compute fib up to 42 with 2 isolates.
     parfib(N, 2).then((v2) {
       var t2 = sw.elapsedMilliseconds;
       sw.stop();
-      print("fib#2(${N}) = ${v2[N]}, ms: $t2");
+      print("fib#2($N) = ${v2[N]}, ms: $t2");
     });
   });
 }
@@ -32,7 +32,7 @@
 Future<List<int>> parfib(int limit, int parallelity) {
   return LoadBalancer.create(parallelity, IsolateRunner.spawn)
       .then((LoadBalancer pool) {
-    var fibs = new List<Future<int>>(limit + 1);
+    var fibs = List<Future<int>>(limit + 1);
     // Schedule all calls with exact load value and the heaviest task
     // assigned first.
     schedule(a, b, i) {
diff --git a/lib/isolate_runner.dart b/lib/isolate_runner.dart
index af7afc8..c1040a1 100644
--- a/lib/isolate_runner.dart
+++ b/lib/isolate_runner.dart
@@ -12,8 +12,8 @@
 import "src/util.dart";
 
 // Command tags. Shared between IsolateRunner and IsolateRunnerRemote.
-const int _SHUTDOWN = 0;
-const int _RUN = 1;
+const int _shutdown = 0;
+const int _run = 1;
 
 /// An easier to use interface on top of an [Isolate].
 ///
@@ -53,16 +53,16 @@
   ///
   /// The created isolate is set to have errors not be fatal.
   static Future<IsolateRunner> spawn() async {
-    var channel = new SingleResponseChannel();
+    var channel = SingleResponseChannel();
     var isolate =
         await Isolate.spawn(IsolateRunnerRemote._create, channel.port);
     // The runner can be used to run multiple independent functions.
     // An accidentally uncaught error shouldn't ruin it for everybody else.
     isolate.setErrorsFatal(false);
-    var pingChannel = new SingleResponseChannel();
+    var pingChannel = SingleResponseChannel();
     isolate.ping(pingChannel.port);
     var commandPort = await channel.result;
-    var result = new IsolateRunner(isolate, commandPort);
+    var result = IsolateRunner(isolate, commandPort);
     // Guarantees that setErrorsFatal has completed.
     await pingChannel.result;
     return result;
@@ -77,8 +77,8 @@
   /// then drop the connection and let the service control the isolate's
   /// life cycle.
   Future<void> close() {
-    var channel = new SingleResponseChannel();
-    _commandPort.send(list2(_SHUTDOWN, channel.port));
+    var channel = SingleResponseChannel();
+    _commandPort.send(list2(_shutdown, channel.port));
     return channel.result.then(ignore);
   }
 
@@ -99,14 +99,14 @@
   /// f.then((_) => print("Dead")
   ///  .timeout(new Duration(...), onTimeout: () => print("No response"));
   /// ```
-  Future kill({Duration timeout: const Duration(seconds: 1)}) {
+  Future kill({Duration timeout = const Duration(seconds: 1)}) {
     Future onExit = singleResponseFuture(isolate.addOnExitListener);
     if (Duration.zero == timeout) {
       isolate.kill(priority: Isolate.immediate);
       return onExit;
     } else {
       // Try a more gentle shutdown sequence.
-      _commandPort.send(list1(_SHUTDOWN));
+      _commandPort.send(list1(_shutdown));
       return onExit.timeout(timeout, onTimeout: () {
         isolate.kill(priority: Isolate.immediate);
         return onExit;
@@ -126,8 +126,8 @@
   /// Guaranteed to only complete after all previous sent isolate commands
   /// (like pause and resume) have been handled.
   /// Paused isolates do respond to ping requests.
-  Future<bool> ping({Duration timeout: const Duration(seconds: 1)}) {
-    var channel = new SingleResponseChannel(
+  Future<bool> ping({Duration timeout = const Duration(seconds: 1)}) {
+    var channel = SingleResponseChannel(
         callback: _kTrue, timeout: timeout, timeoutValue: false);
     isolate.ping(channel.port);
     return channel.result;
@@ -189,7 +189,7 @@
   Future<R> run<R, P>(FutureOr<R> function(P argument), P argument,
       {Duration timeout, onTimeout()}) {
     return singleResultFuture<R>((SendPort port) {
-      _commandPort.send(list4(_RUN, function, argument, port));
+      _commandPort.send(list4(_run, function, argument, port));
     }, timeout: timeout, onTimeout: onTimeout);
   }
 
@@ -211,15 +211,15 @@
         // Uncaught error.
         String errorDescription = message[0];
         String stackDescription = message[1];
-        var error = new RemoteError(errorDescription, stackDescription);
+        var error = RemoteError(errorDescription, stackDescription);
         controller.addError(error, error.stackTrace);
       }
     }
 
-    controller = new StreamController.broadcast(
+    controller = StreamController.broadcast(
         sync: true,
         onListen: () {
-          port = new RawReceivePort(handleError);
+          port = RawReceivePort(handleError);
           isolate.addErrorListener(port.sendPort);
           isolate.addOnExitListener(port.sendPort);
         },
@@ -244,7 +244,7 @@
     // so we can close the receive port for this future?
     // Using [ping] for now.
     if (_onExitFuture == null) {
-      var channel = new SingleResponseChannel();
+      var channel = SingleResponseChannel();
       isolate.addOnExitListener(channel.port);
       _onExitFuture = channel.result.then(ignore);
       ping().then((bool alive) {
@@ -266,7 +266,7 @@
 /// Only use this class if you need to set up the isolate manually
 /// instead of relying on [IsolateRunner.spawn].
 class IsolateRunnerRemote {
-  final RawReceivePort _commandPort = new RawReceivePort();
+  final RawReceivePort _commandPort = RawReceivePort();
   IsolateRunnerRemote() {
     _commandPort.handler = _handleCommand;
   }
@@ -279,23 +279,22 @@
 
   static void _create(Object data) {
     var initPort = data as SendPort;
-    var remote = new IsolateRunnerRemote();
+    var remote = IsolateRunnerRemote();
     initPort.send(remote.commandPort);
   }
 
   void _handleCommand(List<Object> command) {
     switch (command[0]) {
-      case _SHUTDOWN:
+      case _shutdown:
         SendPort responsePort = command[1];
         _commandPort.close();
         responsePort.send(null);
         return;
-      case _RUN:
+      case _run:
         Function function = command[1];
         var argument = command[2];
         SendPort responsePort = command[3];
-        sendFutureResult(
-            new Future.sync(() => function(argument)), responsePort);
+        sendFutureResult(Future.sync(() => function(argument)), responsePort);
         return;
     }
   }
diff --git a/lib/load_balancer.dart b/lib/load_balancer.dart
index 4e415c3..bd41219 100644
--- a/lib/load_balancer.dart
+++ b/lib/load_balancer.dart
@@ -48,15 +48,15 @@
   /// var isolatePool = LoadBalancer.create(10, IsolateRunner.spawn);
   /// ```
   static Future<LoadBalancer> create(int size, Future<Runner> createRunner()) {
-    return Future.wait(new Iterable.generate(size, (_) => createRunner()),
+    return Future.wait(Iterable.generate(size, (_) => createRunner()),
         cleanUp: (Runner runner) {
       runner.close();
-    }).then((runners) => new LoadBalancer(runners));
+    }).then((runners) => LoadBalancer(runners));
   }
 
   static List<_LoadBalancerEntry> _createEntries(Iterable<Runner> runners) {
-    var entries = runners.map((runner) => new _LoadBalancerEntry(runner));
-    return new List<_LoadBalancerEntry>.from(entries, growable: false);
+    var entries = runners.map((runner) => _LoadBalancerEntry(runner));
+    return List<_LoadBalancerEntry>.from(entries, growable: false);
   }
 
   /// Execute the command in the currently least loaded isolate.
@@ -71,7 +71,7 @@
   /// the runner running the function, which will handle a timeout
   /// as normal.
   Future<R> run<R, P>(FutureOr<R> function(P argument), argument,
-      {Duration timeout, FutureOr<R> onTimeout(), int load: 100}) {
+      {Duration timeout, FutureOr<R> onTimeout(), int load = 100}) {
     RangeError.checkNotNegative(load, "load");
     _LoadBalancerEntry entry = _first;
     _increaseLoad(entry, load);
@@ -93,14 +93,14 @@
   /// the runners running the function, which will handle any timeouts
   /// as normal.
   List<Future> runMultiple(int count, function(argument), argument,
-      {Duration timeout, onTimeout(), int load: 100}) {
+      {Duration timeout, onTimeout(), int load = 100}) {
     RangeError.checkValueInInterval(count, 1, _length, "count");
     RangeError.checkNotNegative(load, "load");
     if (count == 1) {
       return list1(run(function, argument,
           load: load, timeout: timeout, onTimeout: onTimeout));
     }
-    List result = new List<Future>(count);
+    List result = List<Future>(count);
     if (count == _length) {
       // No need to change the order of entries in the queue.
       for (int i = 0; i < count; i++) {
@@ -114,7 +114,7 @@
       // command on each, then add them back to the queue.
       // This avoids running the same command twice in the same
       // isolate.
-      List entries = new List(count);
+      List entries = List(count);
       for (int i = 0; i < count; i++) {
         entries[i] = _removeFirst();
       }
@@ -135,7 +135,9 @@
         MultiError.waitUnordered(_queue.take(_length).map((e) => e.close()))
             .then(ignore);
     // Remove all entries.
-    for (int i = 0; i < _length; i++) _queue[i].queueIndex = -1;
+    for (int i = 0; i < _length; i++) {
+      _queue[i].queueIndex = -1;
+    }
     _queue = null;
     _length = 0;
     return _stopFuture;
@@ -208,7 +210,7 @@
 
   /// Adds entry to the queue.
   void _add(_LoadBalancerEntry entry) {
-    if (_stopFuture != null) throw new StateError("LoadBalancer is stopped");
+    if (_stopFuture != null) throw StateError("LoadBalancer is stopped");
     assert(entry.queueIndex < 0);
     if (_queue.length == _length) {
       _grow();
@@ -235,7 +237,7 @@
   }
 
   void _grow() {
-    List newQueue = new List(_length * 2);
+    List newQueue = List(_length * 2);
     newQueue.setRange(0, _length, _queue);
     _queue = newQueue;
   }
diff --git a/lib/ports.dart b/lib/ports.dart
index a65d43e..ec3c55e 100644
--- a/lib/ports.dart
+++ b/lib/ports.dart
@@ -48,7 +48,7 @@
 /// ```
 SendPort singleCallbackPort<P>(void callback(P response),
     {Duration timeout, P timeoutValue}) {
-  RawReceivePort responsePort = new RawReceivePort();
+  RawReceivePort responsePort = RawReceivePort();
   Zone zone = Zone.current;
   callback = zone.registerUnaryCallback(callback);
   Timer timer;
@@ -58,7 +58,7 @@
     zone.runUnary(callback, response as P);
   };
   if (timeout != null) {
-    timer = new Timer(timeout, () {
+    timer = Timer(timeout, () {
       responsePort.close();
       callback(timeoutValue);
     });
@@ -101,7 +101,7 @@
       _castComplete<R>(completer, response);
     });
   }
-  RawReceivePort responsePort = new RawReceivePort();
+  RawReceivePort responsePort = RawReceivePort();
   Timer timer;
   if (callback == null) {
     responsePort.handler = (response) {
@@ -126,13 +126,13 @@
     };
   }
   if (timeout != null) {
-    timer = new Timer(timeout, () {
+    timer = Timer(timeout, () {
       responsePort.close();
       if (onTimeout != null) {
-        completer.complete(new Future.sync(onTimeout));
+        completer.complete(Future.sync(onTimeout));
       } else {
-        completer.completeError(
-            new TimeoutException("Future not completed", timeout));
+        completer
+            .completeError(TimeoutException("Future not completed", timeout));
       }
     });
   }
@@ -161,8 +161,8 @@
 /// The `Future` method won't be able to close the underlying [ReceivePort].
 Future<R> singleResponseFuture<R>(void action(SendPort responsePort),
     {Duration timeout, R timeoutValue}) {
-  Completer<R> completer = new Completer<R>.sync();
-  RawReceivePort responsePort = new RawReceivePort();
+  Completer<R> completer = Completer<R>.sync();
+  RawReceivePort responsePort = RawReceivePort();
   Timer timer;
   Zone zone = Zone.current;
   responsePort.handler = (Object response) {
@@ -173,7 +173,7 @@
     });
   };
   if (timeout != null) {
-    timer = new Timer(timeout, () {
+    timer = Timer(timeout, () {
       responsePort.close();
       completer.complete(timeoutValue);
     });
@@ -224,14 +224,14 @@
 /// a [TimeoutException].
 Future<R> singleResultFuture<R>(void action(SendPort responsePort),
     {Duration timeout, FutureOr<R> onTimeout()}) {
-  var completer = new Completer<R>.sync();
+  var completer = Completer<R>.sync();
   SendPort port = singleCompletePort<R, List<Object>>(completer,
       callback: receiveFutureResult, timeout: timeout, onTimeout: onTimeout);
   try {
     action(port);
   } catch (e, s) {
     // This should not happen.
-    sendFutureResult(new Future.error(e, s), port);
+    sendFutureResult(Future.error(e, s), port);
   }
   return completer.future;
 }
@@ -241,7 +241,7 @@
 /// The [response] must be a message on the format sent by [sendFutureResult].
 void completeFutureResult<R>(List<Object> response, Completer<R> completer) {
   if (response.length == 2) {
-    var error = new RemoteError(response[0], response[1]);
+    var error = RemoteError(response[0], response[1]);
     completer.completeError(error, error.stackTrace);
   } else {
     R result = response[0];
@@ -255,11 +255,11 @@
 /// The [response] must be a message on the format sent by [sendFutureResult].
 Future<R> receiveFutureResult<R>(List<Object> response) {
   if (response.length == 2) {
-    var error = new RemoteError(response[0], response[1]);
-    return new Future.error(error, error.stackTrace);
+    var error = RemoteError(response[0], response[1]);
+    return Future.error(error, error.stackTrace);
   }
   R result = response[0];
-  return new Future<R>.value(result);
+  return Future<R>.value(result);
 }
 
 /// A [Future] and a [SendPort] that can be used to complete the future.
@@ -291,24 +291,24 @@
   SingleResponseChannel(
       {FutureOr<R> callback(Null value),
       Duration timeout,
-      bool throwOnTimeout: false,
+      bool throwOnTimeout = false,
       FutureOr<R> onTimeout(),
       R timeoutValue})
-      : _receivePort = new RawReceivePort(),
-        _completer = new Completer<R>.sync(),
+      : _receivePort = RawReceivePort(),
+        _completer = Completer<R>.sync(),
         _callback = callback,
         _zone = Zone.current {
     _receivePort.handler = _handleResponse;
     if (timeout != null) {
-      _timer = new Timer(timeout, () {
+      _timer = Timer(timeout, () {
         // Executed as a timer event.
         _receivePort.close();
         if (!_completer.isCompleted) {
           if (throwOnTimeout) {
             _completer.completeError(
-                new TimeoutException("Timeout waiting for response", timeout));
+                TimeoutException("Timeout waiting for response", timeout));
           } else if (onTimeout != null) {
-            _completer.complete(new Future.sync(onTimeout));
+            _completer.complete(Future.sync(onTimeout));
           } else {
             _completer.complete(timeoutValue);
           }
@@ -333,7 +333,7 @@
     _cancelTimer();
     if (!_completer.isCompleted) {
       // Not in event tail position, so complete the sync completer later.
-      _completer.complete(new Future.microtask(() => result));
+      _completer.complete(Future.microtask(() => result));
     }
   }
 
@@ -363,7 +363,7 @@
       // created in a different error zone, an error from the root zone
       // would become uncaught.
       _zone.run(() {
-        _completer.complete(new Future.sync(() => _callback(v)));
+        _completer.complete(Future.sync(() => _callback(v)));
       });
     }
   }
diff --git a/lib/registry.dart b/lib/registry.dart
index 4073e4f..f8ed657 100644
--- a/lib/registry.dart
+++ b/lib/registry.dart
@@ -13,12 +13,12 @@
 import "src/util.dart";
 
 // Command tags.
-const int _ADD = 0;
-const int _REMOVE = 1;
-const int _ADD_TAGS = 2;
-const int _REMOVE_TAGS = 3;
-const int _GET_TAGS = 4;
-const int _FIND = 5;
+const int _addValue = 0;
+const int _removeValue = 1;
+const int _addTagsValue = 2;
+const int _removeTagsValue = 3;
+const int _getTagsValue = 4;
+const int _findValue = 5;
 
 /// An isolate-compatible object registry.
 ///
@@ -48,7 +48,7 @@
   // The cache is stored in an [Expando], not on the object.
   // This allows sending the `Registry` object through a `SendPort` without
   // also copying the cache.
-  static final Expando _caches = new Expando();
+  static final Expando _caches = Expando();
 
   /// Port for sending command to the central registry manager.
   SendPort _commandPort;
@@ -67,14 +67,14 @@
   /// this registry should wait before assuming that an operation
   /// has failed.
   Registry.fromPort(SendPort commandPort,
-      {Duration timeout: const Duration(seconds: 5)})
+      {Duration timeout = const Duration(seconds: 5)})
       : _commandPort = commandPort,
         _timeout = timeout;
 
   _RegistryCache get _cache {
     _RegistryCache cache = _caches[this];
     if (cache != null) return cache;
-    cache = new _RegistryCache();
+    cache = _RegistryCache();
     _caches[this] = cache;
     return cache;
   }
@@ -85,7 +85,7 @@
   int _getId(T element) {
     int id = _cache.id(element);
     if (id == null) {
-      throw new StateError("Not an element: ${Error.safeToString(element)}");
+      throw StateError("Not an element: ${Error.safeToString(element)}");
     }
     return id;
   }
@@ -106,12 +106,12 @@
   Future<Capability> add(T element, {Iterable tags}) {
     _RegistryCache cache = _cache;
     if (cache.contains(element)) {
-      return new Future<Capability>.sync(() {
-        throw new StateError(
+      return Future<Capability>.sync(() {
+        throw StateError(
             "Object already in registry: ${Error.safeToString(element)}");
       });
     }
-    var completer = new Completer<Capability>();
+    var completer = Completer<Capability>();
     SendPort port = singleCompletePort(completer,
         callback: (List response) {
           assert(cache.isAdding(element));
@@ -123,11 +123,11 @@
         timeout: _timeout,
         onTimeout: () {
           cache.stopAdding(element);
-          throw new TimeoutException("Future not completed", _timeout);
+          throw TimeoutException("Future not completed", _timeout);
         });
     if (tags != null) tags = tags.toList(growable: false);
     cache.setAdding(element);
-    _commandPort.send(list4(_ADD, element, tags, port));
+    _commandPort.send(list4(_addValue, element, tags, port));
     return completer.future;
   }
 
@@ -142,14 +142,14 @@
   Future<bool> remove(T element, Capability removeCapability) {
     int id = _cache.id(element);
     if (id == null) {
-      return new Future<bool>.value(false);
+      return Future<bool>.value(false);
     }
-    var completer = new Completer<bool>();
+    var completer = Completer<bool>();
     SendPort port = singleCompletePort(completer, callback: (bool result) {
       _cache.remove(id);
       return result;
     }, timeout: _timeout);
-    _commandPort.send(list4(_REMOVE, id, removeCapability, port));
+    _commandPort.send(list4(_removeValue, id, removeCapability, port));
     return completer.future;
   }
 
@@ -177,17 +177,17 @@
   Future<void> removeTags(Iterable<T> elements, Iterable tags) {
     List ids = elements.map(_getId).toList(growable: false);
     tags = tags.toList(growable: false);
-    var completer = new Completer<void>();
+    var completer = Completer<void>();
     SendPort port = singleCompletePort(completer, timeout: _timeout);
-    _commandPort.send(list4(_REMOVE_TAGS, ids, tags, port));
+    _commandPort.send(list4(_removeTagsValue, ids, tags, port));
     return completer.future;
   }
 
   Future<void> _addTags(List<int> ids, Iterable tags) {
     tags = tags.toList(growable: false);
-    var completer = new Completer<void>();
+    var completer = Completer<void>();
     SendPort port = singleCompletePort(completer, timeout: _timeout);
-    _commandPort.send(list4(_ADD_TAGS, ids, tags, port));
+    _commandPort.send(list4(_addTagsValue, ids, tags, port));
     return completer.future;
   }
 
@@ -202,15 +202,15 @@
   /// Otherwise all matching elements are returned.
   Future<List<T>> lookup({Iterable tags, int max}) {
     if (max != null && max < 1) {
-      throw new RangeError.range(max, 1, null, "max");
+      throw RangeError.range(max, 1, null, "max");
     }
     if (tags != null) tags = tags.toList(growable: false);
-    var completer = new Completer<List<T>>();
+    var completer = Completer<List<T>>();
     SendPort port = singleCompletePort(completer, callback: (List response) {
       // Response is even-length list of (id, element) pairs.
       _RegistryCache cache = _cache;
       int count = response.length ~/ 2;
-      List result = new List(count);
+      List result = List(count);
       for (int i = 0; i < count; i++) {
         int id = response[i * 2];
         var element = response[i * 2 + 1];
@@ -219,7 +219,7 @@
       }
       return result;
     }, timeout: _timeout);
-    _commandPort.send(list4(_FIND, tags, max, port));
+    _commandPort.send(list4(_findValue, tags, max, port));
     return completer.future;
   }
 }
@@ -230,14 +230,14 @@
 /// An object is considered an element of the registry if it
 class _RegistryCache {
   // Temporary marker until an object gets an id.
-  static const int _BEING_ADDED = -1;
+  static const int _beingAdded = -1;
 
-  final Map<int, Object> id2object = new HashMap();
-  final Map<Object, int> object2id = new HashMap.identity();
+  final Map<int, Object> id2object = HashMap();
+  final Map<Object, int> object2id = HashMap.identity();
 
   int id(Object object) {
     int result = object2id[object];
-    if (result == _BEING_ADDED) return null;
+    if (result == _beingAdded) return null;
     return result;
   }
 
@@ -254,15 +254,15 @@
     return object;
   }
 
-  bool isAdding(element) => object2id[element] == _BEING_ADDED;
+  bool isAdding(element) => object2id[element] == _beingAdded;
 
   void setAdding(element) {
     assert(!contains(element));
-    object2id[element] = _BEING_ADDED;
+    object2id[element] = _beingAdded;
   }
 
   void stopAdding(element) {
-    assert(object2id[element] == _BEING_ADDED);
+    assert(object2id[element] == _beingAdded);
     object2id.remove(element);
   }
 
@@ -284,17 +284,17 @@
 
   /// Maps id to entry. Each entry contains the id, the element, its tags,
   /// and a capability required to remove it again.
-  final _entries = new HashMap<int, _RegistryEntry>();
-  final _tag2id = new HashMap<Object, Set<int>>();
+  final _entries = HashMap<int, _RegistryEntry>();
+  final _tag2id = HashMap<Object, Set<int>>();
 
   /// Create a new registry managed by the created [RegistryManager].
   ///
   /// The optional [timeout] parameter can be set to the duration
   /// registry objects should wait before assuming that an operation
   /// has failed.
-  RegistryManager({Duration timeout: const Duration(seconds: 5)})
+  RegistryManager({Duration timeout = const Duration(seconds: 5)})
       : _timeout = timeout,
-        _commandPort = new RawReceivePort() {
+        _commandPort = RawReceivePort() {
     _commandPort.handler = _handleCommand;
   }
 
@@ -309,39 +309,39 @@
   /// This registry can be sent to other isolates created using
   /// [Isolate.spawn].
   Registry get registry =>
-      new Registry.fromPort(_commandPort.sendPort, timeout: _timeout);
+      Registry.fromPort(_commandPort.sendPort, timeout: _timeout);
 
   // Used as argument to putIfAbsent.
-  static Set<int> _createSet() => new HashSet<int>();
+  static Set<int> _createSet() => HashSet<int>();
 
   void _handleCommand(List command) {
     switch (command[0]) {
-      case _ADD:
-        _add(command[1], command[2], command[3]);
+      case _addValue:
+        _add(command[1], command[2] as List, command[3] as SendPort);
         return;
-      case _REMOVE:
-        _remove(command[1], command[2], command[3]);
+      case _removeValue:
+        _remove(command[1], command[2] as Capability, command[3] as SendPort);
         return;
-      case _ADD_TAGS:
-        _addTags(command[1], command[2], command[3]);
+      case _addTagsValue:
+        _addTags(command[1], command[2] as List, command[3] as SendPort);
         return;
-      case _REMOVE_TAGS:
-        _removeTags(command[1], command[2], command[3]);
+      case _removeTagsValue:
+        _removeTags(command[1], command[2] as List, command[3] as SendPort);
         return;
-      case _GET_TAGS:
-        _getTags(command[1], command[2]);
+      case _getTagsValue:
+        _getTags(command[1], command[2] as SendPort);
         return;
-      case _FIND:
-        _find(command[1], command[2], command[3]);
+      case _findValue:
+        _find(command[1] as List, command[2] as int, command[3] as SendPort);
         return;
       default:
-        throw new UnsupportedError("Unknown command: ${command[0]}");
+        throw UnsupportedError("Unknown command: ${command[0]}");
     }
   }
 
   void _add(Object object, List tags, SendPort replyPort) {
     int id = ++_nextId;
-    var entry = new _RegistryEntry(id, object);
+    var entry = _RegistryEntry(id, object);
     _entries[id] = entry;
     if (tags != null) {
       for (var tag in tags) {
@@ -461,7 +461,7 @@
 class _RegistryEntry {
   final int id;
   final Object element;
-  final Set tags = new HashSet();
-  final Capability removeCapability = new Capability();
+  final Set tags = HashSet();
+  final Capability removeCapability = Capability();
   _RegistryEntry(this.id, this.element);
 }
diff --git a/lib/runner.dart b/lib/runner.dart
index b050a38..0f6cc98 100644
--- a/lib/runner.dart
+++ b/lib/runner.dart
@@ -37,7 +37,7 @@
   /// The default implementation runs the function in the current isolate.
   Future<R> run<R, P>(FutureOr<R> function(P argument), P argument,
       {Duration timeout, FutureOr<R> onTimeout()}) {
-    Future result = new Future.sync(() => function(argument));
+    Future result = Future.sync(() => function(argument));
     if (timeout != null) {
       result = result.timeout(timeout, onTimeout: onTimeout);
     }
@@ -49,5 +49,5 @@
   /// If the runner has allocated resources, e.g., an isolate, it should
   /// be released. No further calls to [run] should be made after calling
   /// stop.
-  Future close() => new Future.value();
+  Future close() => Future.value();
 }
diff --git a/lib/src/errors.dart b/lib/src/errors.dart
index 81a5d6b..ec938b8 100644
--- a/lib/src/errors.dart
+++ b/lib/src/errors.dart
@@ -17,9 +17,9 @@
   // A best-effort attempt is made at keeping below this number of lines
   // in the output.
   // If there are too many errors, they will all get at least one line.
-  static const int _MAX_LINES = 55;
+  static const int _maxLines = 55;
   // Minimum number of lines in the toString for each error.
-  static const int _MIN_LINES_PER_ERROR = 1;
+  static const int _minLinesPerError = 1;
 
   /// The actual errors.
   final List errors;
@@ -57,7 +57,7 @@
         return;
       }
       var errorList = results.sublist(results.length - errors);
-      completer.completeError(new MultiError(errorList));
+      completer.completeError(MultiError(errorList));
     }
 
     var handleValue = (T v) {
@@ -66,7 +66,7 @@
       // calling Future.then, probably by misusing a synchronous completer.
       results[values++] = v;
       if (errors > 0 && cleanUp != null) {
-        new Future.sync(() => cleanUp(v));
+        Future.sync(() => cleanUp(v));
       }
       checkDone();
     };
@@ -74,7 +74,7 @@
       if (errors == 0 && cleanUp != null) {
         for (int i = 0; i < values; i++) {
           var value = results[i];
-          if (value != null) new Future.sync(() => cleanUp(value));
+          if (value != null) Future.sync(() => cleanUp(value));
         }
       }
       results[results.length - ++errors] = e;
@@ -84,9 +84,9 @@
       count++;
       future.then(handleValue, onError: handleError);
     }
-    if (count == 0) return new Future.value(new List(0));
-    results = new List(count);
-    completer = new Completer();
+    if (count == 0) return Future.value(List(0));
+    results = List(count);
+    completer = Completer();
     return completer.future;
   }
 
@@ -116,7 +116,7 @@
         completer.complete(results);
         return;
       }
-      completer.completeError(new MultiError(results));
+      completer.completeError(MultiError(results));
     }
 
     for (var future in futures) {
@@ -126,7 +126,7 @@
         if (!hasError) {
           results[i] = v;
         } else if (cleanUp != null) {
-          new Future.sync(() => cleanUp(v));
+          Future.sync(() => cleanUp(v));
         }
         checkDone();
       }, onError: (e, s) {
@@ -134,28 +134,28 @@
           if (cleanUp != null) {
             for (int i = 0; i < results.length; i++) {
               var result = results[i];
-              if (result != null) new Future.sync(() => cleanUp(result));
+              if (result != null) Future.sync(() => cleanUp(result));
             }
           }
-          results = new List<Object>(count);
+          results = List<Object>(count);
           hasError = true;
         }
         results[i] = e;
         checkDone();
       });
     }
-    if (count == 0) return new Future.value(new List(0));
-    results = new List<T>(count);
-    completer = new Completer();
+    if (count == 0) return Future.value(List(0));
+    results = List<T>(count);
+    completer = Completer();
     return completer.future;
   }
 
   String toString() {
-    StringBuffer buffer = new StringBuffer();
+    StringBuffer buffer = StringBuffer();
     buffer.write("Multiple Errors:\n");
-    int linesPerError = _MAX_LINES ~/ errors.length;
-    if (linesPerError < _MIN_LINES_PER_ERROR) {
-      linesPerError = _MIN_LINES_PER_ERROR;
+    int linesPerError = _maxLines ~/ errors.length;
+    if (linesPerError < _minLinesPerError) {
+      linesPerError = _minLinesPerError;
     }
 
     for (int index = 0; index < errors.length; index++) {
diff --git a/lib/src/raw_receive_port_multiplexer.dart b/lib/src/raw_receive_port_multiplexer.dart
index a284af1..6392424 100644
--- a/lib/src/raw_receive_port_multiplexer.dart
+++ b/lib/src/raw_receive_port_multiplexer.dart
@@ -35,7 +35,7 @@
 
   _MultiplexRawReceivePort(this._multiplexer, this._id, this._handler);
 
-  void set handler(Function handler) {
+  set handler(Function handler) {
     this._handler = handler;
   }
 
@@ -63,8 +63,8 @@
 /// A shared [RawReceivePort] that distributes messages to
 /// [RawReceivePort] instances that it manages.
 class RawReceivePortMultiplexer {
-  final RawReceivePort _port = new RawReceivePort();
-  final Map<int, _MultiplexRawReceivePort> _map = new HashMap();
+  final RawReceivePort _port = RawReceivePort();
+  final Map<int, _MultiplexRawReceivePort> _map = HashMap();
   int _nextId = 0;
 
   RawReceivePortMultiplexer() {
@@ -73,7 +73,7 @@
 
   RawReceivePort createRawReceivePort([void handler(value)]) {
     int id = _nextId++;
-    var result = new _MultiplexRawReceivePort(this, id, handler);
+    var result = _MultiplexRawReceivePort(this, id, handler);
     _map[id] = result;
     return result;
   }
@@ -93,7 +93,7 @@
   }
 
   SendPort _createSendPort(int id) {
-    return new _MultiplexSendPort(id, _port.sendPort);
+    return _MultiplexSendPort(id, _port.sendPort);
   }
 
   void _closePort(int id) {
diff --git a/lib/src/util.dart b/lib/src/util.dart
index 7c55ff4..989dd28 100644
--- a/lib/src/util.dart
+++ b/lib/src/util.dart
@@ -10,21 +10,21 @@
 void ignore(_) {}
 
 /// Create a single-element fixed-length list.
-List<Object> list1(Object v1) => new List(1)..[0] = v1;
+List<Object> list1(Object v1) => List(1)..[0] = v1;
 
 /// Create a two-element fixed-length list.
-List<Object> list2(Object v1, Object v2) => new List(2)
+List<Object> list2(Object v1, Object v2) => List(2)
   ..[0] = v1
   ..[1] = v2;
 
 /// Create a three-element fixed-length list.
-List<Object> list3(Object v1, Object v2, Object v3) => new List(3)
+List<Object> list3(Object v1, Object v2, Object v3) => List(3)
   ..[0] = v1
   ..[1] = v2
   ..[2] = v3;
 
 /// Create a four-element fixed-length list.
-List<Object> list4(Object v1, Object v2, Object v3, Object v4) => new List(4)
+List<Object> list4(Object v1, Object v2, Object v3, Object v4) => List(4)
   ..[0] = v1
   ..[1] = v2
   ..[2] = v3
@@ -32,7 +32,7 @@
 
 /// Create a five-element fixed-length list.
 List<Object> list5(Object v1, Object v2, Object v3, Object v4, Object v5) =>
-    new List(5)
+    List(5)
       ..[0] = v1
       ..[1] = v2
       ..[2] = v3
diff --git a/pubspec.yaml b/pubspec.yaml
index b9f140f..d1f1594 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,9 +1,13 @@
 name: isolate
-version: 2.0.2
+version: 2.0.3-dev
 author: Dart Team <misc@dartlang.org>
-description: Utility functions and classes related to the 'dart:isolate' library.
+description: >-
+  Utility functions and classes related to the 'dart:isolate' library.
 homepage: https://github.com/dart-lang/isolate
+
 environment:
-  sdk: '>=2.0.0-dev.55.0 <3.0.0'
+  sdk: '>=2.0.0 <3.0.0'
+
 dev_dependencies:
+  pedantic: ^1.0.0
   test: ^1.0.0
diff --git a/test/isolaterunner_test.dart b/test/isolaterunner_test.dart
index ce0fb7a..8917bdd 100644
--- a/test/isolaterunner_test.dart
+++ b/test/isolaterunner_test.dart
@@ -10,7 +10,7 @@
 import "package:isolate/isolate_runner.dart";
 import "package:test/test.dart";
 
-const MS = const Duration(milliseconds: 1);
+const _ms = Duration(milliseconds: 1);
 
 void main() {
   test("create-close", testCreateClose);
@@ -36,10 +36,10 @@
 
 Future testSeparateIsolates() {
   // Check that each isolate has its own _global variable.
-  return Future.wait(new Iterable.generate(2, (_) => IsolateRunner.spawn()))
+  return Future.wait(Iterable.generate(2, (_) => IsolateRunner.spawn()))
       .then((runners) {
     Future runAll(action(IsolateRunner runner, int index)) {
-      var indices = new Iterable.generate(runners.length);
+      var indices = Iterable.generate(runners.length);
       return Future.wait(indices.map((i) => action(runners[i], i)));
     }
 
@@ -60,7 +60,7 @@
     bool mayComplete = false;
     return IsolateRunner.spawn().then((isolate) {
       isolate.pause();
-      new Future.delayed(MS * 500, () {
+      Future.delayed(_ms * 500, () {
         mayComplete = true;
         isolate.resume();
       });
@@ -71,17 +71,17 @@
     });
   });
   test("pause2", () {
-    Capability c1 = new Capability();
-    Capability c2 = new Capability();
+    Capability c1 = Capability();
+    Capability c2 = Capability();
     int mayCompleteCount = 2;
     return IsolateRunner.spawn().then((isolate) {
       isolate.pause(c1);
       isolate.pause(c2);
-      new Future.delayed(MS * 500, () {
+      Future.delayed(_ms * 500, () {
         mayCompleteCount--;
         isolate.resume(c1);
       });
-      new Future.delayed(MS * 500, () {
+      Future.delayed(_ms * 500, () {
         mayCompleteCount--;
         isolate.resume(c2);
       });
diff --git a/test/ports_test.dart b/test/ports_test.dart
index 7029de1..0baf791 100644
--- a/test/ports_test.dart
+++ b/test/ports_test.dart
@@ -10,7 +10,7 @@
 import "package:isolate/ports.dart";
 import "package:test/test.dart";
 
-const Duration MS = const Duration(milliseconds: 1);
+const Duration _ms = Duration(milliseconds: 1);
 
 main() {
   group("SingleCallbackPort", testSingleCallbackPort);
@@ -22,7 +22,7 @@
 
 void testSingleCallbackPort() {
   test("Value", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     SendPort p = singleCallbackPort(completer.complete);
     p.send(42);
     return completer.future.then((v) {
@@ -31,7 +31,7 @@
   });
 
   test("FirstValue", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     SendPort p = singleCallbackPort(completer.complete);
     p.send(42);
     p.send(37);
@@ -40,7 +40,7 @@
     });
   });
   test("Value", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     SendPort p = singleCallbackPort(completer.complete);
     p.send(42);
     return completer.future.then((v) {
@@ -49,8 +49,8 @@
   });
 
   test("ValueBeforeTimeout", () {
-    Completer completer = new Completer.sync();
-    SendPort p = singleCallbackPort(completer.complete, timeout: MS * 500);
+    Completer completer = Completer.sync();
+    SendPort p = singleCallbackPort(completer.complete, timeout: _ms * 500);
     p.send(42);
     return completer.future.then((v) {
       expect(v, 42);
@@ -58,18 +58,19 @@
   });
 
   test("Timeout", () {
-    Completer completer = new Completer.sync();
-    singleCallbackPort(completer.complete, timeout: MS * 100, timeoutValue: 37);
+    Completer completer = Completer.sync();
+    singleCallbackPort(completer.complete,
+        timeout: _ms * 100, timeoutValue: 37);
     return completer.future.then((v) {
       expect(v, 37);
     });
   });
 
   test("TimeoutFirst", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     SendPort p = singleCallbackPort(completer.complete,
-        timeout: MS * 100, timeoutValue: 37);
-    new Timer(MS * 500, () => p.send(42));
+        timeout: _ms * 100, timeoutValue: 37);
+    Timer(_ms * 500, () => p.send(42));
     return completer.future.then((v) {
       expect(v, 37);
     });
@@ -78,7 +79,7 @@
 
 void testSingleCompletePort() {
   test("Value", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     SendPort p = singleCompletePort(completer);
     p.send(42);
     return completer.future.then((v) {
@@ -87,7 +88,7 @@
   });
 
   test("ValueCallback", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     SendPort p = singleCompletePort(completer, callback: (v) {
       expect(42, v);
       return 87;
@@ -99,10 +100,10 @@
   });
 
   test("ValueCallbackFuture", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     SendPort p = singleCompletePort(completer, callback: (v) {
       expect(42, v);
-      return new Future.delayed(MS * 500, () => 88);
+      return Future.delayed(_ms * 500, () => 88);
     });
     p.send(42);
     return completer.future.then((v) {
@@ -111,7 +112,7 @@
   });
 
   test("ValueCallbackThrows", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     SendPort p = singleCompletePort(completer, callback: (v) {
       expect(42, v);
       throw 89;
@@ -125,10 +126,10 @@
   });
 
   test("ValueCallbackThrowsFuture", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     SendPort p = singleCompletePort(completer, callback: (v) {
       expect(42, v);
-      return new Future.error(90);
+      return Future.error(90);
     });
     p.send(42);
     return completer.future.then((v) {
@@ -139,7 +140,7 @@
   });
 
   test("FirstValue", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     SendPort p = singleCompletePort(completer);
     p.send(42);
     p.send(37);
@@ -149,7 +150,7 @@
   });
 
   test("FirstValueCallback", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     SendPort p = singleCompletePort(completer, callback: (v) {
       expect(v, 42);
       return 87;
@@ -162,8 +163,8 @@
   });
 
   test("ValueBeforeTimeout", () {
-    Completer completer = new Completer.sync();
-    SendPort p = singleCompletePort(completer, timeout: MS * 500);
+    Completer completer = Completer.sync();
+    SendPort p = singleCompletePort(completer, timeout: _ms * 500);
     p.send(42);
     return completer.future.then((v) {
       expect(v, 42);
@@ -171,8 +172,8 @@
   });
 
   test("Timeout", () {
-    Completer completer = new Completer.sync();
-    singleCompletePort(completer, timeout: MS * 100);
+    Completer completer = Completer.sync();
+    singleCompletePort(completer, timeout: _ms * 100);
     return completer.future.then((v) {
       fail("unreachable");
     }, onError: (e, s) {
@@ -181,16 +182,17 @@
   });
 
   test("TimeoutCallback", () {
-    Completer completer = new Completer.sync();
-    singleCompletePort(completer, timeout: MS * 100, onTimeout: () => 87);
+    Completer completer = Completer.sync();
+    singleCompletePort(completer, timeout: _ms * 100, onTimeout: () => 87);
     return completer.future.then((v) {
       expect(v, 87);
     });
   });
 
   test("TimeoutCallbackThrows", () {
-    Completer completer = new Completer.sync();
-    singleCompletePort(completer, timeout: MS * 100, onTimeout: () => throw 91);
+    Completer completer = Completer.sync();
+    singleCompletePort(completer,
+        timeout: _ms * 100, onTimeout: () => throw 91);
     return completer.future.then((v) {
       fail("unreachable");
     }, onError: (e, s) {
@@ -199,18 +201,18 @@
   });
 
   test("TimeoutCallbackFuture", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     singleCompletePort(completer,
-        timeout: MS * 100, onTimeout: () => new Future.value(87));
+        timeout: _ms * 100, onTimeout: () => Future.value(87));
     return completer.future.then((v) {
       expect(v, 87);
     });
   });
 
   test("TimeoutCallbackThrowsFuture", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     singleCompletePort(completer,
-        timeout: MS * 100, onTimeout: () => new Future.error(92));
+        timeout: _ms * 100, onTimeout: () => Future.error(92));
     return completer.future.then((v) {
       fail("unreachable");
     }, onError: (e, s) {
@@ -219,20 +221,20 @@
   });
 
   test("TimeoutCallbackSLow", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     singleCompletePort(completer,
-        timeout: MS * 100,
-        onTimeout: () => new Future.delayed(MS * 500, () => 87));
+        timeout: _ms * 100,
+        onTimeout: () => Future.delayed(_ms * 500, () => 87));
     return completer.future.then((v) {
       expect(v, 87);
     });
   });
 
   test("TimeoutCallbackThrowsSlow", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     singleCompletePort(completer,
-        timeout: MS * 100,
-        onTimeout: () => new Future.delayed(MS * 500, () => throw 87));
+        timeout: _ms * 100,
+        onTimeout: () => Future.delayed(_ms * 500, () => throw 87));
     return completer.future.then((v) {
       fail("unreachable");
     }, onError: (e, s) {
@@ -241,10 +243,10 @@
   });
 
   test("TimeoutFirst", () {
-    Completer completer = new Completer.sync();
+    Completer completer = Completer.sync();
     SendPort p =
-        singleCompletePort(completer, timeout: MS * 100, onTimeout: () => 37);
-    new Timer(MS * 500, () => p.send(42));
+        singleCompletePort(completer, timeout: _ms * 100, onTimeout: () => 37);
+    Timer(_ms * 500, () => p.send(42));
     return completer.future.then((v) {
       expect(v, 37);
     });
@@ -282,7 +284,7 @@
   test("FutureTimeout", () {
     return singleResponseFuture((SendPort p) {
       // no-op.
-    }, timeout: MS * 100)
+    }, timeout: _ms * 100)
         .then((v) {
       expect(v, null);
     });
@@ -291,7 +293,7 @@
   test("FutureTimeoutValue", () {
     return singleResponseFuture((SendPort p) {
       // no-op.
-    }, timeout: MS * 100, timeoutValue: 42)
+    }, timeout: _ms * 100, timeoutValue: 42)
         .then((v) {
       expect(v, 42);
     });
@@ -301,7 +303,7 @@
 void testSingleResultFuture() {
   test("Value", () {
     return singleResultFuture((SendPort p) {
-      sendFutureResult(new Future.value(42), p);
+      sendFutureResult(Future.value(42), p);
     }).then((v) {
       expect(v, 42);
     });
@@ -309,8 +311,8 @@
 
   test("ValueFirst", () {
     return singleResultFuture((SendPort p) {
-      sendFutureResult(new Future.value(42), p);
-      sendFutureResult(new Future.value(37), p);
+      sendFutureResult(Future.value(42), p);
+      sendFutureResult(Future.value(37), p);
     }).then((v) {
       expect(v, 42);
     });
@@ -318,7 +320,7 @@
 
   test("Error", () {
     return singleResultFuture((SendPort p) {
-      sendFutureResult(new Future.error(94), p);
+      sendFutureResult(Future.error(94), p);
     }).then((v) {
       fail("unreachable");
     }, onError: (e, s) {
@@ -328,8 +330,8 @@
 
   test("ErrorFirst", () {
     return singleResultFuture((SendPort p) {
-      sendFutureResult(new Future.error(95), p);
-      sendFutureResult(new Future.error(96), p);
+      sendFutureResult(Future.error(95), p);
+      sendFutureResult(Future.error(96), p);
     }).then((v) {
       fail("unreachable");
     }, onError: (e, s) {
@@ -350,7 +352,7 @@
   test("Timeout", () {
     return singleResultFuture((SendPort p) {
       // no-op.
-    }, timeout: MS * 100)
+    }, timeout: _ms * 100)
         .then((v) {
       fail("unreachable");
     }, onError: (e, s) {
@@ -361,7 +363,7 @@
   test("TimeoutValue", () {
     return singleResultFuture((SendPort p) {
       // no-op.
-    }, timeout: MS * 100, onTimeout: () => 42).then((v) {
+    }, timeout: _ms * 100, onTimeout: () => 42).then((v) {
       expect(v, 42);
     });
   });
@@ -369,7 +371,7 @@
   test("TimeoutError", () {
     return singleResultFuture((SendPort p) {
       // no-op.
-    }, timeout: MS * 100, onTimeout: () => throw 97).then((v) {
+    }, timeout: _ms * 100, onTimeout: () => throw 97).then((v) {
       expect(v, 42);
     }, onError: (e, s) {
       expect(e, 97);
@@ -379,7 +381,7 @@
 
 void testSingleResponseChannel() {
   test("Value", () {
-    var channel = new SingleResponseChannel();
+    var channel = SingleResponseChannel();
     channel.port.send(42);
     return channel.result.then((v) {
       expect(v, 42);
@@ -387,7 +389,7 @@
   });
 
   test("ValueFirst", () {
-    var channel = new SingleResponseChannel();
+    var channel = SingleResponseChannel();
     channel.port.send(42);
     channel.port.send(37);
     return channel.result.then((v) {
@@ -396,7 +398,7 @@
   });
 
   test("ValueCallback", () {
-    var channel = new SingleResponseChannel(callback: (v) => 2 * v);
+    var channel = SingleResponseChannel(callback: (v) => 2 * v);
     channel.port.send(42);
     return channel.result.then((v) {
       expect(v, 84);
@@ -404,7 +406,7 @@
   });
 
   test("ErrorCallback", () {
-    var channel = new SingleResponseChannel(callback: (v) => throw 42);
+    var channel = SingleResponseChannel(callback: (v) => throw 42);
     channel.port.send(37);
     return channel.result.then((v) {
       fail("unreachable");
@@ -414,8 +416,7 @@
   });
 
   test("AsyncValueCallback", () {
-    var channel =
-        new SingleResponseChannel(callback: (v) => new Future.value(2 * v));
+    var channel = SingleResponseChannel(callback: (v) => Future.value(2 * v));
     channel.port.send(42);
     return channel.result.then((v) {
       expect(v, 84);
@@ -423,8 +424,7 @@
   });
 
   test("AsyncErrorCallback", () {
-    var channel =
-        new SingleResponseChannel(callback: (v) => new Future.error(42));
+    var channel = SingleResponseChannel(callback: (v) => Future.error(42));
     channel.port.send(37);
     return channel.result.then((v) {
       fail("unreachable");
@@ -434,7 +434,7 @@
   });
 
   test("Timeout", () {
-    var channel = new SingleResponseChannel(timeout: MS * 100);
+    var channel = SingleResponseChannel(timeout: _ms * 100);
     return channel.result.then((v) {
       expect(v, null);
     });
@@ -442,7 +442,7 @@
 
   test("TimeoutThrow", () {
     var channel =
-        new SingleResponseChannel(timeout: MS * 100, throwOnTimeout: true);
+        SingleResponseChannel(timeout: _ms * 100, throwOnTimeout: true);
     return channel.result.then((v) {
       fail("unreachable");
     }, onError: (v, s) {
@@ -451,8 +451,8 @@
   });
 
   test("TimeoutThrowOnTimeoutAndValue", () {
-    var channel = new SingleResponseChannel(
-        timeout: MS * 100,
+    var channel = SingleResponseChannel(
+        timeout: _ms * 100,
         throwOnTimeout: true,
         onTimeout: () => 42,
         timeoutValue: 42);
@@ -465,23 +465,22 @@
 
   test("TimeoutOnTimeout", () {
     var channel =
-        new SingleResponseChannel(timeout: MS * 100, onTimeout: () => 42);
+        SingleResponseChannel(timeout: _ms * 100, onTimeout: () => 42);
     return channel.result.then((v) {
       expect(v, 42);
     });
   });
 
   test("TimeoutOnTimeoutAndValue", () {
-    var channel = new SingleResponseChannel(
-        timeout: MS * 100, onTimeout: () => 42, timeoutValue: 37);
+    var channel = SingleResponseChannel(
+        timeout: _ms * 100, onTimeout: () => 42, timeoutValue: 37);
     return channel.result.then((v) {
       expect(v, 42);
     });
   });
 
   test("TimeoutValue", () {
-    var channel =
-        new SingleResponseChannel(timeout: MS * 100, timeoutValue: 42);
+    var channel = SingleResponseChannel(timeout: _ms * 100, timeoutValue: 42);
     return channel.result.then((v) {
       expect(v, 42);
     });
@@ -489,7 +488,7 @@
 
   test("TimeoutOnTimeoutError", () {
     var channel =
-        new SingleResponseChannel(timeout: MS * 100, onTimeout: () => throw 42);
+        SingleResponseChannel(timeout: _ms * 100, onTimeout: () => throw 42);
     return channel.result.then((v) {
       fail("unreachable");
     }, onError: (v, s) {
@@ -498,16 +497,16 @@
   });
 
   test("TimeoutOnTimeoutAsync", () {
-    var channel = new SingleResponseChannel(
-        timeout: MS * 100, onTimeout: () => new Future.value(42));
+    var channel = SingleResponseChannel(
+        timeout: _ms * 100, onTimeout: () => Future.value(42));
     return channel.result.then((v) {
       expect(v, 42);
     });
   });
 
   test("TimeoutOnTimeoutAsyncError", () {
-    var channel = new SingleResponseChannel(
-        timeout: MS * 100, onTimeout: () => new Future.error(42));
+    var channel = SingleResponseChannel(
+        timeout: _ms * 100, onTimeout: () => Future.error(42));
     return channel.result.then((v) {
       fail("unreachable");
     }, onError: (v, s) {
diff --git a/test/registry_test.dart b/test/registry_test.dart
index 76d0420..5cb5ce1 100644
--- a/test/registry_test.dart
+++ b/test/registry_test.dart
@@ -12,7 +12,7 @@
 
 import "package:test/test.dart";
 
-const MS = const Duration(milliseconds: 1);
+const _ms = Duration(milliseconds: 1);
 
 void main() {
   group("lookup", testLookup);
@@ -25,22 +25,22 @@
   group("ObjectsAndTags", testObjectsAndTags);
 }
 
-class Oddity {
-  static const int EVEN = 0;
-  static const int ODD = 1;
+abstract class Oddity {
+  static const int even = 0;
+  static const int odd = 1;
 }
 
 Future<List> waitAll(int n, Future action(int n)) {
-  return Future.wait(new Iterable.generate(n, action));
+  return Future.wait(Iterable.generate(n, action));
 }
 
 void testLookup() {
   test("All", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
     return waitAll(10, (i) {
-      var element = new Element(i);
-      var tag = i.isEven ? Oddity.EVEN : Oddity.ODD;
+      var element = Element(i);
+      var tag = i.isEven ? Oddity.even : Oddity.odd;
       return registry.add(element, tags: [tag]);
     }).then((_) {
       return registry.lookup();
@@ -52,14 +52,14 @@
   });
 
   test("Odd", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
     return waitAll(10, (i) {
-      var element = new Element(i);
-      var tag = i.isEven ? Oddity.EVEN : Oddity.ODD;
+      var element = Element(i);
+      var tag = i.isEven ? Oddity.even : Oddity.odd;
       return registry.add(element, tags: [tag]);
     }).then((_) {
-      return registry.lookup(tags: [Oddity.ODD]);
+      return registry.lookup(tags: [Oddity.odd]);
     }).then((all) {
       expect(all.length, 5);
       expect(all.map((v) => v.id).toList()..sort(), [1, 3, 5, 7, 9]);
@@ -67,11 +67,11 @@
   });
 
   test("Max", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
     return waitAll(10, (i) {
-      var element = new Element(i);
-      var tag = i.isEven ? Oddity.EVEN : Oddity.ODD;
+      var element = Element(i);
+      var tag = i.isEven ? Oddity.even : Oddity.odd;
       return registry.add(element, tags: [tag]);
     }).then((_) {
       return registry.lookup(max: 5);
@@ -81,10 +81,10 @@
   });
 
   test("MultiTag", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
     return waitAll(25, (i) {
-      var element = new Element(i);
+      var element = Element(i);
       // Collect all numbers dividing i.
       var tags = [i];
       for (int j = 2; j < 25; j++) {
@@ -100,10 +100,10 @@
   });
 
   test("MultiTagMax", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
     return waitAll(25, (i) {
-      var element = new Element(i);
+      var element = Element(i);
       // Collect all numbers dividing i.
       var tags = [i];
       for (int j = 2; j < 25; j++) {
@@ -121,9 +121,9 @@
 
 void testAddLookup() {
   test("Add-lookup-identical", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
-    var object = new Object();
+    var object = Object();
     return registry.add(object).then((_) {
       return registry.lookup();
     }).then((entries) {
@@ -133,11 +133,11 @@
   });
 
   test("Add-multiple-identical", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
-    var object1 = new Object();
-    var object2 = new Object();
-    var object3 = new Object();
+    var object1 = Object();
+    var object2 = Object();
+    var object3 = Object();
     var objects = [object1, object2, object3];
     return Future.wait(objects.map(registry.add)).then((_) {
       return registry.lookup();
@@ -150,9 +150,9 @@
   });
 
   test("Add-twice", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
-    var object = new Object();
+    var object = Object();
     return registry.add(object).then((_) {
       return registry.add(object);
     }).then((_) {
@@ -163,10 +163,10 @@
   });
 
   test("Add-lookup-add-lookup", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
-    var object = new Object();
-    var object2 = new Object();
+    var object = Object();
+    var object2 = Object();
     return registry.add(object).then((_) {
       return registry.lookup();
     }).then((entries) {
@@ -188,9 +188,9 @@
   });
 
   test("lookup-add-lookup", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
-    var object = new Object();
+    var object = Object();
     return registry.lookup().then((entries) {
       expect(entries, isEmpty);
       return registry.add(object);
@@ -203,11 +203,11 @@
   });
 
   test("Add-multiple-tags", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
-    var object1 = new Object();
-    var object2 = new Object();
-    var object3 = new Object();
+    var object1 = Object();
+    var object2 = Object();
+    var object3 = Object();
     return registry.add(object1, tags: [1, 3, 5, 7]).then((_) {
       return registry.add(object2, tags: [2, 3, 6, 7]);
     }).then((_) {
@@ -234,9 +234,9 @@
 
 void testRemove() {
   test("Add-remove", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
-    var object = new Object();
+    var object = Object();
     return registry.add(object).then((removeCapability) {
       return registry.lookup().then((entries) {
         expect(entries, hasLength(1));
@@ -252,14 +252,14 @@
   });
 
   test("Add-remove-fail", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
-    var object = new Object();
+    var object = Object();
     return registry.add(object).then((removeCapability) {
       return registry.lookup().then((entries) {
         expect(entries, hasLength(1));
         expect(entries.first, same(object));
-        return registry.remove(object, new Capability());
+        return registry.remove(object, Capability());
       });
     }).then((removeSuccess) {
       expect(removeSuccess, isFalse);
@@ -269,9 +269,9 @@
 
 void testAddRemoveTags() {
   test("Add-remove-tag", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
-    var object = new Object();
+    var object = Object();
     return registry.add(object).then((removeCapability) {
       return registry.lookup(tags: ["x"]);
     }).then((entries) {
@@ -291,9 +291,9 @@
   });
 
   test("Tag-twice", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
-    var object = new Object();
+    var object = Object();
     return registry.add(object, tags: ["x"]).then((removeCapability) {
       return registry.lookup(tags: ["x"]);
     }).then((entries) {
@@ -316,11 +316,11 @@
   });
 
   test("Add-remove-multiple", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
-    var object1 = new Object();
-    var object2 = new Object();
-    var object3 = new Object();
+    var object1 = Object();
+    var object2 = Object();
+    var object3 = Object();
     var objects = [object1, object2, object3];
     return Future.wait(objects.map(registry.add)).then((_) {
       return registry.addTags([object1, object2], ["x", "y"]);
@@ -341,16 +341,16 @@
   });
 
   test("Remove-wrong-object", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry = regman.registry;
-    expect(() => registry.removeTags([new Object()], ["x"]), throwsStateError);
+    expect(() => registry.removeTags([Object()], ["x"]), throwsStateError);
     regman.close();
   });
 }
 
 var _regmen = {};
 Registry createRegMan(id) {
-  var regman = new RegistryManager();
+  var regman = RegistryManager();
   _regmen[id] = regman;
   return regman.registry;
 }
@@ -360,7 +360,7 @@
 }
 
 void testCrossIsolate() {
-  var object = new Object();
+  var object = Object();
   test("regman-other-isolate", () {
     // Add, lookup and remove object in other isolate.
     return IsolateRunner.spawn().then((isolate) {
@@ -385,10 +385,10 @@
 
 void testTimeout() {
   test("Timeout-add", () {
-    RegistryManager regman = new RegistryManager(timeout: MS * 500);
+    RegistryManager regman = RegistryManager(timeout: _ms * 500);
     Registry registry = regman.registry;
     regman.close();
-    return registry.add(new Object()).then((_) {
+    return registry.add(Object()).then((_) {
       fail("unreachable");
     }, onError: (e, s) {
       expect(e is TimeoutException, isTrue);
@@ -396,9 +396,9 @@
   });
 
   test("Timeout-remove", () {
-    RegistryManager regman = new RegistryManager(timeout: MS * 500);
+    RegistryManager regman = RegistryManager(timeout: _ms * 500);
     Registry registry = regman.registry;
-    var object = new Object();
+    var object = Object();
     return registry.add(object).then((rc) {
       regman.close();
       return registry.remove(object, rc).then((_) {
@@ -410,9 +410,9 @@
   });
 
   test("Timeout-addTags", () {
-    RegistryManager regman = new RegistryManager(timeout: MS * 500);
+    RegistryManager regman = RegistryManager(timeout: _ms * 500);
     Registry registry = regman.registry;
-    var object = new Object();
+    var object = Object();
     return registry.add(object).then((rc) {
       regman.close();
       return registry.addTags([object], ["x"]).then((_) {
@@ -424,9 +424,9 @@
   });
 
   test("Timeout-removeTags", () {
-    RegistryManager regman = new RegistryManager(timeout: MS * 500);
+    RegistryManager regman = RegistryManager(timeout: _ms * 500);
     Registry registry = regman.registry;
-    var object = new Object();
+    var object = Object();
     return registry.add(object).then((rc) {
       regman.close();
       return registry.removeTags([object], ["x"]).then((_) {
@@ -438,7 +438,7 @@
   });
 
   test("Timeout-lookup", () {
-    RegistryManager regman = new RegistryManager(timeout: MS * 500);
+    RegistryManager regman = RegistryManager(timeout: _ms * 500);
     Registry registry = regman.registry;
     regman.close();
     registry.lookup().then((_) {
@@ -451,7 +451,7 @@
 
 void testMultiRegistry() {
   test("dual-registry", () {
-    RegistryManager regman = new RegistryManager();
+    RegistryManager regman = RegistryManager();
     Registry registry1 = regman.registry;
     Registry registry2 = regman.registry;
     var l1 = ["x"];
@@ -482,7 +482,7 @@
   testObject(object) {
     String name = "Transfer-${object.runtimeType}";
     test(name, () {
-      RegistryManager regman = new RegistryManager();
+      RegistryManager regman = RegistryManager();
       Registry registry1 = regman.registry;
       Registry registry2 = regman.registry;
       return registry1.add(object, tags: [object]).then((removeCapability) {
@@ -517,10 +517,10 @@
   testObject("string");
   testObject(true);
   testObject(null);
-  testObject(new Element(42));
+  testObject(Element(42));
   testObject(#symbol);
   testObject(#_privateSymbol);
-  testObject(new Capability());
+  testObject(Capability());
   testObject(topLevelFunction);
 }