Merge pull request #12 from dart-lang/lints

Update to latest pedantic, fix for lints
diff --git a/analysis_options.yaml b/analysis_options.yaml
index a940b32..642b1d5 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -1,3 +1,4 @@
+include: package:pedantic/analysis_options.yaml
 analyzer:
   strong-mode:
     implicit-casts: false
diff --git a/lib/src/constants.dart b/lib/src/constants.dart
index 3dfea39..c2739a3 100644
--- a/lib/src/constants.dart
+++ b/lib/src/constants.dart
@@ -4,9 +4,7 @@
 
 library utf.constants;
 
-/**
- * Invalid codepoints or encodings may be substituted with the value U+fffd.
- */
+/// Invalid codepoints or encodings may be substituted with the value U+fffd.
 const int UNICODE_REPLACEMENT_CHARACTER_CODEPOINT = 0xfffd;
 const int UNICODE_BOM = 0xfeff;
 const int UNICODE_UTF_BOM_LO = 0xff;
diff --git a/lib/src/list_range.dart b/lib/src/list_range.dart
index 3f211d8..aef29ec 100644
--- a/lib/src/list_range.dart
+++ b/lib/src/list_range.dart
@@ -6,11 +6,9 @@
 
 import 'dart:collection';
 
-/**
- * _ListRange in an internal type used to create a lightweight Interable on a
- * range within a source list. DO NOT MODIFY the underlying list while
- * iterating over it. The results of doing so are undefined.
- */
+/// _ListRange in an internal type used to create a lightweight Interable on a
+/// range within a source list. DO NOT MODIFY the underlying list while
+/// iterating over it. The results of doing so are undefined.
 // TODO(floitsch): Consider removing the extend and switch to implements since
 // that's cheaper to allocate.
 class ListRange extends IterableBase<int> {
@@ -23,27 +21,25 @@
         this._offset = offset,
         this._length = (length == null ? source.length - offset : length) {
     if (_offset < 0 || _offset > _source.length) {
-      throw new RangeError.value(_offset);
+      throw RangeError.value(_offset);
     }
     if (_length != null && (_length < 0)) {
-      throw new RangeError.value(_length);
+      throw RangeError.value(_length);
     }
     if (_length + _offset > _source.length) {
-      throw new RangeError.value(_length + _offset);
+      throw RangeError.value(_length + _offset);
     }
   }
 
   ListRangeIterator get iterator =>
-      new _ListRangeIteratorImpl(_source, _offset, _offset + _length);
+      _ListRangeIteratorImpl(_source, _offset, _offset + _length);
 
   int get length => _length;
 }
 
-/**
- * The ListRangeIterator provides more capabilities than a standard iterator,
- * including the ability to get the current position, count remaining items,
- * and move forward/backward within the iterator.
- */
+/// The ListRangeIterator provides more capabilities than a standard iterator,
+/// including the ability to get the current position, count remaining items,
+/// and move forward/backward within the iterator.
 abstract class ListRangeIterator implements Iterator<int> {
   bool moveNext();
   int get current;
diff --git a/lib/src/shared.dart b/lib/src/shared.dart
index 257def3..acd9ccb 100644
--- a/lib/src/shared.dart
+++ b/lib/src/shared.dart
@@ -5,9 +5,7 @@
 import 'util.dart';
 
 // TODO(jmesserly): would be nice to have this on String (dartbug.com/6501).
-/**
- * Provide a list of Unicode codepoints for a given string.
- */
+/// Provide a list of Unicode codepoints for a given string.
 List<int> stringToCodepoints(String str) {
   // Note: str.codeUnits gives us 16-bit code units on all Dart implementations.
   // So we need to convert.
diff --git a/lib/src/utf16.dart b/lib/src/utf16.dart
index 9d63fb0..2bba5aa 100644
--- a/lib/src/utf16.dart
+++ b/lib/src/utf16.dart
@@ -11,141 +11,123 @@
 import 'utf_16_code_unit_decoder.dart';
 import 'util.dart';
 
-/**
- * Generate a string from the provided Unicode codepoints.
- *
- * *Deprecated* Use [String.fromCharCodes] instead.
- */
+/// Generate a string from the provided Unicode codepoints.
+///
+/// *Deprecated* Use [String.fromCharCodes] instead.
 @deprecated
 String codepointsToString(List<int> codepoints) {
-  return new String.fromCharCodes(codepoints);
+  return String.fromCharCodes(codepoints);
 }
 
-/**
- * Decodes the UTF-16 bytes as an iterable. Thus, the consumer can only convert
- * as much of the input as needed. Determines the byte order from the BOM,
- * or uses big-endian as a default. This method always strips a leading BOM.
- * Set the [replacementCodepoint] to null to throw an ArgumentError
- * rather than replace the bad value. The default value for
- * [replacementCodepoint] is U+FFFD.
- */
+/// Decodes the UTF-16 bytes as an iterable. Thus, the consumer can only convert
+/// as much of the input as needed. Determines the byte order from the BOM,
+/// or uses big-endian as a default. This method always strips a leading BOM.
+/// Set the [replacementCodepoint] to null to throw an ArgumentError
+/// rather than replace the bad value. The default value for
+/// [replacementCodepoint] is U+FFFD.
 IterableUtf16Decoder decodeUtf16AsIterable(List<int> bytes,
     [int offset = 0,
     int length,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  return new IterableUtf16Decoder._(
-      () => new Utf16BytesToCodeUnitsDecoder(
+  return IterableUtf16Decoder._(
+      () => Utf16BytesToCodeUnitsDecoder(
           bytes, offset, length, replacementCodepoint),
       replacementCodepoint);
 }
 
-/**
- * Decodes the UTF-16BE bytes as an iterable. Thus, the consumer can only
- * convert as much of the input as needed. This method strips a leading BOM by
- * default, but can be overridden by setting the optional parameter [stripBom]
- * to false. Set the [replacementCodepoint] to null to throw an
- * ArgumentError rather than replace the bad value. The default
- * value for the [replacementCodepoint] is U+FFFD.
- */
+/// Decodes the UTF-16BE bytes as an iterable. Thus, the consumer can only
+/// convert as much of the input as needed. This method strips a leading BOM by
+/// default, but can be overridden by setting the optional parameter [stripBom]
+/// to false. Set the [replacementCodepoint] to null to throw an
+/// ArgumentError rather than replace the bad value. The default
+/// value for the [replacementCodepoint] is U+FFFD.
 IterableUtf16Decoder decodeUtf16beAsIterable(List<int> bytes,
     [int offset = 0,
     int length,
     bool stripBom = true,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  return new IterableUtf16Decoder._(
-      () => new Utf16beBytesToCodeUnitsDecoder(
+  return IterableUtf16Decoder._(
+      () => Utf16beBytesToCodeUnitsDecoder(
           bytes, offset, length, stripBom, replacementCodepoint),
       replacementCodepoint);
 }
 
-/**
- * Decodes the UTF-16LE bytes as an iterable. Thus, the consumer can only
- * convert as much of the input as needed. This method strips a leading BOM by
- * default, but can be overridden by setting the optional parameter [stripBom]
- * to false. Set the [replacementCodepoint] to null to throw an
- * ArgumentError rather than replace the bad value. The default
- * value for the [replacementCodepoint] is U+FFFD.
- */
+/// Decodes the UTF-16LE bytes as an iterable. Thus, the consumer can only
+/// convert as much of the input as needed. This method strips a leading BOM by
+/// default, but can be overridden by setting the optional parameter [stripBom]
+/// to false. Set the [replacementCodepoint] to null to throw an
+/// ArgumentError rather than replace the bad value. The default
+/// value for the [replacementCodepoint] is U+FFFD.
 IterableUtf16Decoder decodeUtf16leAsIterable(List<int> bytes,
     [int offset = 0,
     int length,
     bool stripBom = true,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  return new IterableUtf16Decoder._(
-      () => new Utf16leBytesToCodeUnitsDecoder(
+  return IterableUtf16Decoder._(
+      () => Utf16leBytesToCodeUnitsDecoder(
           bytes, offset, length, stripBom, replacementCodepoint),
       replacementCodepoint);
 }
 
-/**
- * Produce a String from a sequence of UTF-16 encoded bytes. This method always
- * strips a leading BOM. Set the [replacementCodepoint] to null to throw  an
- * ArgumentError rather than replace the bad value. The default
- * value for the [replacementCodepoint] is U+FFFD.
- */
+/// Produce a String from a sequence of UTF-16 encoded bytes. This method always
+/// strips a leading BOM. Set the [replacementCodepoint] to null to throw  an
+/// ArgumentError rather than replace the bad value. The default
+/// value for the [replacementCodepoint] is U+FFFD.
 String decodeUtf16(List<int> bytes,
     [int offset = 0,
     int length,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  Utf16BytesToCodeUnitsDecoder decoder = new Utf16BytesToCodeUnitsDecoder(
-      bytes, offset, length, replacementCodepoint);
+  Utf16BytesToCodeUnitsDecoder decoder =
+      Utf16BytesToCodeUnitsDecoder(bytes, offset, length, replacementCodepoint);
   List<int> codeunits = decoder.decodeRest();
-  return new String.fromCharCodes(
+  return String.fromCharCodes(
       utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
 }
 
-/**
- * Produce a String from a sequence of UTF-16BE encoded bytes. This method
- * strips a leading BOM by default, but can be overridden by setting the
- * optional parameter [stripBom] to false. Set the [replacementCodepoint] to
- * null to throw an ArgumentError rather than replace the bad value.
- * The default value for the [replacementCodepoint] is U+FFFD.
- */
+/// Produce a String from a sequence of UTF-16BE encoded bytes. This method
+/// strips a leading BOM by default, but can be overridden by setting the
+/// optional parameter [stripBom] to false. Set the [replacementCodepoint] to
+/// null to throw an ArgumentError rather than replace the bad value.
+/// The default value for the [replacementCodepoint] is U+FFFD.
 String decodeUtf16be(List<int> bytes,
     [int offset = 0,
     int length,
     bool stripBom = true,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  List<int> codeunits = (new Utf16beBytesToCodeUnitsDecoder(
+  List<int> codeunits = (Utf16beBytesToCodeUnitsDecoder(
           bytes, offset, length, stripBom, replacementCodepoint))
       .decodeRest();
-  return new String.fromCharCodes(
+  return String.fromCharCodes(
       utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
 }
 
-/**
- * Produce a String from a sequence of UTF-16LE encoded bytes. This method
- * strips a leading BOM by default, but can be overridden by setting the
- * optional parameter [stripBom] to false. Set the [replacementCodepoint] to
- * null to throw an ArgumentError rather than replace the bad value.
- * The default value for the [replacementCodepoint] is U+FFFD.
- */
+/// Produce a String from a sequence of UTF-16LE encoded bytes. This method
+/// strips a leading BOM by default, but can be overridden by setting the
+/// optional parameter [stripBom] to false. Set the [replacementCodepoint] to
+/// null to throw an ArgumentError rather than replace the bad value.
+/// The default value for the [replacementCodepoint] is U+FFFD.
 String decodeUtf16le(List<int> bytes,
     [int offset = 0,
     int length,
     bool stripBom = true,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  List<int> codeunits = (new Utf16leBytesToCodeUnitsDecoder(
+  List<int> codeunits = (Utf16leBytesToCodeUnitsDecoder(
           bytes, offset, length, stripBom, replacementCodepoint))
       .decodeRest();
-  return new String.fromCharCodes(
+  return String.fromCharCodes(
       utf16CodeUnitsToCodepoints(codeunits, 0, null, replacementCodepoint));
 }
 
-/**
- * Produce a list of UTF-16 encoded bytes. This method prefixes the resulting
- * bytes with a big-endian byte-order-marker.
- */
+/// Produce a list of UTF-16 encoded bytes. This method prefixes the resulting
+/// bytes with a big-endian byte-order-marker.
 List<int> encodeUtf16(String str) => encodeUtf16be(str, true);
 
-/**
- * Produce a list of UTF-16BE encoded bytes. By default, this method produces
- * UTF-16BE bytes with no BOM.
- */
+/// Produce a list of UTF-16BE encoded bytes. By default, this method produces
+/// UTF-16BE bytes with no BOM.
 List<int> encodeUtf16be(String str, [bool writeBOM = false]) {
   List<int> utf16CodeUnits = _stringToUtf16CodeUnits(str);
   List<int> encoding =
-      new List<int>(2 * utf16CodeUnits.length + (writeBOM ? 2 : 0));
+      List<int>(2 * utf16CodeUnits.length + (writeBOM ? 2 : 0));
   int i = 0;
   if (writeBOM) {
     encoding[i++] = UNICODE_UTF_BOM_HI;
@@ -158,14 +140,12 @@
   return encoding;
 }
 
-/**
- * Produce a list of UTF-16LE encoded bytes. By default, this method produces
- * UTF-16LE bytes with no BOM.
- */
+/// Produce a list of UTF-16LE encoded bytes. By default, this method produces
+/// UTF-16LE bytes with no BOM.
 List<int> encodeUtf16le(String str, [bool writeBOM = false]) {
   List<int> utf16CodeUnits = _stringToUtf16CodeUnits(str);
   List<int> encoding =
-      new List<int>(2 * utf16CodeUnits.length + (writeBOM ? 2 : 0));
+      List<int>(2 * utf16CodeUnits.length + (writeBOM ? 2 : 0));
   int i = 0;
   if (writeBOM) {
     encoding[i++] = UNICODE_UTF_BOM_LO;
@@ -178,19 +158,15 @@
   return encoding;
 }
 
-/**
- * Identifies whether a List of bytes starts (based on offset) with a
- * byte-order marker (BOM).
- */
+/// Identifies whether a List of bytes starts (based on offset) with a
+/// byte-order marker (BOM).
 bool hasUtf16Bom(List<int> utf32EncodedBytes, [int offset = 0, int length]) {
   return hasUtf16beBom(utf32EncodedBytes, offset, length) ||
       hasUtf16leBom(utf32EncodedBytes, offset, length);
 }
 
-/**
- * Identifies whether a List of bytes starts (based on offset) with a
- * big-endian byte-order marker (BOM).
- */
+/// Identifies whether a List of bytes starts (based on offset) with a
+/// big-endian byte-order marker (BOM).
 bool hasUtf16beBom(List<int> utf16EncodedBytes, [int offset = 0, int length]) {
   int end = length != null ? offset + length : utf16EncodedBytes.length;
   return (offset + 2) <= end &&
@@ -198,10 +174,8 @@
       utf16EncodedBytes[offset + 1] == UNICODE_UTF_BOM_LO;
 }
 
-/**
- * Identifies whether a List of bytes starts (based on offset) with a
- * little-endian byte-order marker (BOM).
- */
+/// Identifies whether a List of bytes starts (based on offset) with a
+/// little-endian byte-order marker (BOM).
 bool hasUtf16leBom(List<int> utf16EncodedBytes, [int offset = 0, int length]) {
   int end = length != null ? offset + length : utf16EncodedBytes.length;
   return (offset + 2) <= end &&
@@ -215,11 +189,9 @@
 
 typedef ListRangeIterator _CodeUnitsProvider();
 
-/**
- * Return type of [decodeUtf16AsIterable] and variants. The Iterable type
- * provides an iterator on demand and the iterator will only translate bytes
- * as requested by the user of the iterator. (Note: results are not cached.)
- */
+/// Return type of [decodeUtf16AsIterable] and variants. The Iterable type
+/// provides an iterator on demand and the iterator will only translate bytes
+/// as requested by the user of the iterator. (Note: results are not cached.)
 // TODO(floitsch): Consider removing the extend and switch to implements since
 // that's cheaper to allocate.
 class IterableUtf16Decoder extends IterableBase<int> {
@@ -229,15 +201,13 @@
   IterableUtf16Decoder._(this.codeunitsProvider, this.replacementCodepoint);
 
   Utf16CodeUnitDecoder get iterator =>
-      new Utf16CodeUnitDecoder.fromListRangeIterator(
+      Utf16CodeUnitDecoder.fromListRangeIterator(
           codeunitsProvider(), replacementCodepoint);
 }
 
-/**
- * Convert UTF-16 encoded bytes to UTF-16 code units by grouping 1-2 bytes
- * to produce the code unit (0-(2^16)-1). Relies on BOM to determine
- * endian-ness, and defaults to BE.
- */
+/// Convert UTF-16 encoded bytes to UTF-16 code units by grouping 1-2 bytes
+/// to produce the code unit (0-(2^16)-1). Relies on BOM to determine
+/// endian-ness, and defaults to BE.
 abstract class Utf16BytesToCodeUnitsDecoder implements ListRangeIterator {
   // TODO(kevmoo): should this field be private?
   final ListRangeIterator utf16EncodedBytesIterator;
@@ -255,24 +225,22 @@
       length = utf16EncodedBytes.length - offset;
     }
     if (hasUtf16beBom(utf16EncodedBytes, offset, length)) {
-      return new Utf16beBytesToCodeUnitsDecoder(utf16EncodedBytes, offset + 2,
+      return Utf16beBytesToCodeUnitsDecoder(utf16EncodedBytes, offset + 2,
           length - 2, false, replacementCodepoint);
     } else if (hasUtf16leBom(utf16EncodedBytes, offset, length)) {
-      return new Utf16leBytesToCodeUnitsDecoder(utf16EncodedBytes, offset + 2,
+      return Utf16leBytesToCodeUnitsDecoder(utf16EncodedBytes, offset + 2,
           length - 2, false, replacementCodepoint);
     } else {
-      return new Utf16beBytesToCodeUnitsDecoder(
+      return Utf16beBytesToCodeUnitsDecoder(
           utf16EncodedBytes, offset, length, false, replacementCodepoint);
     }
   }
 
-  /**
-   * Provides a fast way to decode the rest of the source bytes in a single
-   * call. This method trades memory for improved speed in that it potentially
-   * over-allocates the List containing results.
-   */
+  /// Provides a fast way to decode the rest of the source bytes in a single
+  /// call. This method trades memory for improved speed in that it potentially
+  /// over-allocates the List containing results.
   List<int> decodeRest() {
-    List<int> codeunits = new List<int>(remaining);
+    List<int> codeunits = List<int>(remaining);
     int i = 0;
     while (moveNext()) {
       codeunits[i++] = current;
@@ -280,7 +248,7 @@
     if (i == codeunits.length) {
       return codeunits;
     } else {
-      List<int> truncCodeunits = new List<int>(i);
+      List<int> truncCodeunits = List<int>(i);
       truncCodeunits.setRange(0, i, codeunits);
       return truncCodeunits;
     }
@@ -301,7 +269,7 @@
         _current = replacementCodepoint;
         return true;
       } else {
-        throw new ArgumentError(
+        throw ArgumentError(
             "Invalid UTF16 at ${utf16EncodedBytesIterator.position}");
       }
     }
@@ -324,10 +292,8 @@
   int decode();
 }
 
-/**
- * Convert UTF-16BE encoded bytes to utf16 code units by grouping 1-2 bytes
- * to produce the code unit (0-(2^16)-1).
- */
+/// Convert UTF-16BE encoded bytes to utf16 code units by grouping 1-2 bytes
+/// to produce the code unit (0-(2^16)-1).
 class Utf16beBytesToCodeUnitsDecoder extends Utf16BytesToCodeUnitsDecoder {
   Utf16beBytesToCodeUnitsDecoder(List<int> utf16EncodedBytes,
       [int offset = 0,
@@ -335,7 +301,7 @@
       bool stripBom = true,
       int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT])
       : super._fromListRangeIterator(
-            (new ListRange(utf16EncodedBytes, offset, length)).iterator,
+            (ListRange(utf16EncodedBytes, offset, length)).iterator,
             replacementCodepoint) {
     if (stripBom && hasUtf16beBom(utf16EncodedBytes, offset, length)) {
       skip();
@@ -351,10 +317,8 @@
   }
 }
 
-/**
- * Convert UTF-16LE encoded bytes to utf16 code units by grouping 1-2 bytes
- * to produce the code unit (0-(2^16)-1).
- */
+/// Convert UTF-16LE encoded bytes to utf16 code units by grouping 1-2 bytes
+/// to produce the code unit (0-(2^16)-1).
 class Utf16leBytesToCodeUnitsDecoder extends Utf16BytesToCodeUnitsDecoder {
   Utf16leBytesToCodeUnitsDecoder(List<int> utf16EncodedBytes,
       [int offset = 0,
@@ -362,7 +326,7 @@
       bool stripBom = true,
       int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT])
       : super._fromListRangeIterator(
-            (new ListRange(utf16EncodedBytes, offset, length)).iterator,
+            (ListRange(utf16EncodedBytes, offset, length)).iterator,
             replacementCodepoint) {
     if (stripBom && hasUtf16leBom(utf16EncodedBytes, offset, length)) {
       skip();
diff --git a/lib/src/utf32.dart b/lib/src/utf32.dart
index bf7d341..5d0a1aa 100644
--- a/lib/src/utf32.dart
+++ b/lib/src/utf32.dart
@@ -10,115 +10,99 @@
 import 'list_range.dart';
 import 'shared.dart';
 
-/**
- * Decodes the UTF-32 bytes as an iterable. Thus, the consumer can only convert
- * as much of the input as needed. Determines the byte order from the BOM,
- * or uses big-endian as a default. This method always strips a leading BOM.
- * Set the replacementCharacter to null to throw an ArgumentError
- * rather than replace the bad value.
- */
+/// Decodes the UTF-32 bytes as an iterable. Thus, the consumer can only convert
+/// as much of the input as needed. Determines the byte order from the BOM,
+/// or uses big-endian as a default. This method always strips a leading BOM.
+/// Set the replacementCharacter to null to throw an ArgumentError
+/// rather than replace the bad value.
 IterableUtf32Decoder decodeUtf32AsIterable(List<int> bytes,
     [int offset = 0,
     int length,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  return new IterableUtf32Decoder._(
-      () => new Utf32BytesDecoder(bytes, offset, length, replacementCodepoint));
+  return IterableUtf32Decoder._(
+      () => Utf32BytesDecoder(bytes, offset, length, replacementCodepoint));
 }
 
-/**
- * Decodes the UTF-32BE bytes as an iterable. Thus, the consumer can only convert
- * as much of the input as needed. This method strips a leading BOM by default,
- * but can be overridden by setting the optional parameter [stripBom] to false.
- * Set the replacementCharacter to null to throw an ArgumentError
- * rather than replace the bad value.
- */
+/// Decodes the UTF-32BE bytes as an iterable. Thus, the consumer can only convert
+/// as much of the input as needed. This method strips a leading BOM by default,
+/// but can be overridden by setting the optional parameter [stripBom] to false.
+/// Set the replacementCharacter to null to throw an ArgumentError
+/// rather than replace the bad value.
 IterableUtf32Decoder decodeUtf32beAsIterable(List<int> bytes,
     [int offset = 0,
     int length,
     bool stripBom = true,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  return new IterableUtf32Decoder._(() => new Utf32beBytesDecoder(
+  return IterableUtf32Decoder._(() => Utf32beBytesDecoder(
       bytes, offset, length, stripBom, replacementCodepoint));
 }
 
-/**
- * Decodes the UTF-32LE bytes as an iterable. Thus, the consumer can only convert
- * as much of the input as needed. This method strips a leading BOM by default,
- * but can be overridden by setting the optional parameter [stripBom] to false.
- * Set the replacementCharacter to null to throw an ArgumentError
- * rather than replace the bad value.
- */
+/// Decodes the UTF-32LE bytes as an iterable. Thus, the consumer can only convert
+/// as much of the input as needed. This method strips a leading BOM by default,
+/// but can be overridden by setting the optional parameter [stripBom] to false.
+/// Set the replacementCharacter to null to throw an ArgumentError
+/// rather than replace the bad value.
 IterableUtf32Decoder decodeUtf32leAsIterable(List<int> bytes,
     [int offset = 0,
     int length,
     bool stripBom = true,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  return new IterableUtf32Decoder._(() => new Utf32leBytesDecoder(
+  return IterableUtf32Decoder._(() => Utf32leBytesDecoder(
       bytes, offset, length, stripBom, replacementCodepoint));
 }
 
-/**
- * Produce a String from a sequence of UTF-32 encoded bytes. The parameters
- * allow an offset into a list of bytes (as int), limiting the length of the
- * values be decoded and the ability of override the default Unicode
- * replacement character. Set the replacementCharacter to null to throw an
- * ArgumentError rather than replace the bad value.
- */
+/// Produce a String from a sequence of UTF-32 encoded bytes. The parameters
+/// allow an offset into a list of bytes (as int), limiting the length of the
+/// values be decoded and the ability of override the default Unicode
+/// replacement character. Set the replacementCharacter to null to throw an
+/// ArgumentError rather than replace the bad value.
 String decodeUtf32(List<int> bytes,
     [int offset = 0,
     int length,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  return new String.fromCharCodes(
-      (new Utf32BytesDecoder(bytes, offset, length, replacementCodepoint))
+  return String.fromCharCodes(
+      (Utf32BytesDecoder(bytes, offset, length, replacementCodepoint))
           .decodeRest());
 }
 
-/**
- * Produce a String from a sequence of UTF-32BE encoded bytes. The parameters
- * allow an offset into a list of bytes (as int), limiting the length of the
- * values be decoded and the ability of override the default Unicode
- * replacement character. Set the replacementCharacter to null to throw an
- * ArgumentError rather than replace the bad value.
- */
+/// Produce a String from a sequence of UTF-32BE encoded bytes. The parameters
+/// allow an offset into a list of bytes (as int), limiting the length of the
+/// values be decoded and the ability of override the default Unicode
+/// replacement character. Set the replacementCharacter to null to throw an
+/// ArgumentError rather than replace the bad value.
 String decodeUtf32be(List<int> bytes,
         [int offset = 0,
         int length,
         bool stripBom = true,
         int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) =>
-    new String.fromCharCodes((new Utf32beBytesDecoder(
+    String.fromCharCodes((Utf32beBytesDecoder(
             bytes, offset, length, stripBom, replacementCodepoint))
         .decodeRest());
 
-/**
- * Produce a String from a sequence of UTF-32LE encoded bytes. The parameters
- * allow an offset into a list of bytes (as int), limiting the length of the
- * values be decoded and the ability of override the default Unicode
- * replacement character. Set the replacementCharacter to null to throw an
- * ArgumentError rather than replace the bad value.
- */
+/// Produce a String from a sequence of UTF-32LE encoded bytes. The parameters
+/// allow an offset into a list of bytes (as int), limiting the length of the
+/// values be decoded and the ability of override the default Unicode
+/// replacement character. Set the replacementCharacter to null to throw an
+/// ArgumentError rather than replace the bad value.
 String decodeUtf32le(List<int> bytes,
         [int offset = 0,
         int length,
         bool stripBom = true,
         int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) =>
-    new String.fromCharCodes((new Utf32leBytesDecoder(
+    String.fromCharCodes((Utf32leBytesDecoder(
             bytes, offset, length, stripBom, replacementCodepoint))
         .decodeRest());
 
-/**
- * Produce a list of UTF-32 encoded bytes. This method prefixes the resulting
- * bytes with a big-endian byte-order-marker.
- */
+/// Produce a list of UTF-32 encoded bytes. This method prefixes the resulting
+/// bytes with a big-endian byte-order-marker.
 List<int> encodeUtf32(String str) => encodeUtf32be(str, true);
 
-/**
- * Produce a list of UTF-32BE encoded bytes. By default, this method produces
- * UTF-32BE bytes with no BOM.
- */
+/// Produce a list of UTF-32BE encoded bytes. By default, this method produces
+/// UTF-32BE bytes with no BOM.
 List<int> encodeUtf32be(String str, [bool writeBOM = false]) {
   List<int> utf32CodeUnits = stringToCodepoints(str);
   List<int> encoding =
-      new List<int>(4 * utf32CodeUnits.length + (writeBOM ? 4 : 0));
+      List<int>(4 * utf32CodeUnits.length + (writeBOM ? 4 : 0));
   int i = 0;
   if (writeBOM) {
     encoding[i++] = 0;
@@ -135,14 +119,12 @@
   return encoding;
 }
 
-/**
- * Produce a list of UTF-32LE encoded bytes. By default, this method produces
- * UTF-32BE bytes with no BOM.
- */
+/// Produce a list of UTF-32LE encoded bytes. By default, this method produces
+/// UTF-32BE bytes with no BOM.
 List<int> encodeUtf32le(String str, [bool writeBOM = false]) {
   List<int> utf32CodeUnits = stringToCodepoints(str);
   List<int> encoding =
-      new List<int>(4 * utf32CodeUnits.length + (writeBOM ? 4 : 0));
+      List<int>(4 * utf32CodeUnits.length + (writeBOM ? 4 : 0));
   int i = 0;
   if (writeBOM) {
     encoding[i++] = UNICODE_UTF_BOM_LO;
@@ -159,19 +141,15 @@
   return encoding;
 }
 
-/**
- * Identifies whether a List of bytes starts (based on offset) with a
- * byte-order marker (BOM).
- */
+/// Identifies whether a List of bytes starts (based on offset) with a
+/// byte-order marker (BOM).
 bool hasUtf32Bom(List<int> utf32EncodedBytes, [int offset = 0, int length]) {
   return hasUtf32beBom(utf32EncodedBytes, offset, length) ||
       hasUtf32leBom(utf32EncodedBytes, offset, length);
 }
 
-/**
- * Identifies whether a List of bytes starts (based on offset) with a
- * big-endian byte-order marker (BOM).
- */
+/// Identifies whether a List of bytes starts (based on offset) with a
+/// big-endian byte-order marker (BOM).
 bool hasUtf32beBom(List<int> utf32EncodedBytes, [int offset = 0, int length]) {
   int end = length != null ? offset + length : utf32EncodedBytes.length;
   return (offset + 4) <= end &&
@@ -181,10 +159,8 @@
       utf32EncodedBytes[offset + 3] == UNICODE_UTF_BOM_LO;
 }
 
-/**
- * Identifies whether a List of bytes starts (based on offset) with a
- * little-endian byte-order marker (BOM).
- */
+/// Identifies whether a List of bytes starts (based on offset) with a
+/// little-endian byte-order marker (BOM).
 bool hasUtf32leBom(List<int> utf32EncodedBytes, [int offset = 0, int length]) {
   int end = length != null ? offset + length : utf32EncodedBytes.length;
   return (offset + 4) <= end &&
@@ -196,11 +172,9 @@
 
 typedef Utf32BytesDecoder Utf32BytesDecoderProvider();
 
-/**
- * Return type of [decodeUtf32AsIterable] and variants. The Iterable type
- * provides an iterator on demand and the iterator will only translate bytes
- * as requested by the user of the iterator. (Note: results are not cached.)
- */
+/// Return type of [decodeUtf32AsIterable] and variants. The Iterable type
+/// provides an iterator on demand and the iterator will only translate bytes
+/// as requested by the user of the iterator. (Note: results are not cached.)
 // TODO(floitsch): Consider removing the extend and switch to implements since
 // that's cheaper to allocate.
 class IterableUtf32Decoder extends IterableBase<int> {
@@ -211,9 +185,7 @@
   Utf32BytesDecoder get iterator => codeunitsProvider();
 }
 
-/**
- * Abstrace parent class converts encoded bytes to codepoints.
- */
+/// Abstrace parent class converts encoded bytes to codepoints.
 abstract class Utf32BytesDecoder implements ListRangeIterator {
   // TODO(kevmoo): should this field be private?
   final ListRangeIterator utf32EncodedBytesIterator;
@@ -231,19 +203,19 @@
       length = utf32EncodedBytes.length - offset;
     }
     if (hasUtf32beBom(utf32EncodedBytes, offset, length)) {
-      return new Utf32beBytesDecoder(utf32EncodedBytes, offset + 4, length - 4,
+      return Utf32beBytesDecoder(utf32EncodedBytes, offset + 4, length - 4,
           false, replacementCodepoint);
     } else if (hasUtf32leBom(utf32EncodedBytes, offset, length)) {
-      return new Utf32leBytesDecoder(utf32EncodedBytes, offset + 4, length - 4,
+      return Utf32leBytesDecoder(utf32EncodedBytes, offset + 4, length - 4,
           false, replacementCodepoint);
     } else {
-      return new Utf32beBytesDecoder(
+      return Utf32beBytesDecoder(
           utf32EncodedBytes, offset, length, false, replacementCodepoint);
     }
   }
 
   List<int> decodeRest() {
-    List<int> codeunits = new List<int>(remaining);
+    List<int> codeunits = List<int>(remaining);
     int i = 0;
     while (moveNext()) {
       codeunits[i++] = current;
@@ -266,7 +238,7 @@
         _current = replacementCodepoint;
         return true;
       } else {
-        throw new ArgumentError(
+        throw ArgumentError(
             "Invalid UTF32 at ${utf32EncodedBytesIterator.position}");
       }
     }
@@ -278,7 +250,7 @@
       _current = replacementCodepoint;
       return true;
     } else {
-      throw new ArgumentError(
+      throw ArgumentError(
           "Invalid UTF32 at ${utf32EncodedBytesIterator.position}");
     }
   }
@@ -298,10 +270,8 @@
   int decode();
 }
 
-/**
- * Convert UTF-32BE encoded bytes to codepoints by grouping 4 bytes
- * to produce the unicode codepoint.
- */
+/// Convert UTF-32BE encoded bytes to codepoints by grouping 4 bytes
+/// to produce the unicode codepoint.
 class Utf32beBytesDecoder extends Utf32BytesDecoder {
   Utf32beBytesDecoder(List<int> utf32EncodedBytes,
       [int offset = 0,
@@ -309,7 +279,7 @@
       bool stripBom = true,
       int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT])
       : super._fromListRangeIterator(
-            (new ListRange(utf32EncodedBytes, offset, length)).iterator,
+            (ListRange(utf32EncodedBytes, offset, length)).iterator,
             replacementCodepoint) {
     if (stripBom && hasUtf32beBom(utf32EncodedBytes, offset, length)) {
       skip();
@@ -329,10 +299,8 @@
   }
 }
 
-/**
- * Convert UTF-32BE encoded bytes to codepoints by grouping 4 bytes
- * to produce the unicode codepoint.
- */
+/// Convert UTF-32BE encoded bytes to codepoints by grouping 4 bytes
+/// to produce the unicode codepoint.
 class Utf32leBytesDecoder extends Utf32BytesDecoder {
   Utf32leBytesDecoder(List<int> utf32EncodedBytes,
       [int offset = 0,
@@ -340,7 +308,7 @@
       bool stripBom = true,
       int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT])
       : super._fromListRangeIterator(
-            (new ListRange(utf32EncodedBytes, offset, length)).iterator,
+            (ListRange(utf32EncodedBytes, offset, length)).iterator,
             replacementCodepoint) {
     if (stripBom && hasUtf32leBom(utf32EncodedBytes, offset, length)) {
       skip();
diff --git a/lib/src/utf8.dart b/lib/src/utf8.dart
index 970c166..d6b37d5 100644
--- a/lib/src/utf8.dart
+++ b/lib/src/utf8.dart
@@ -29,37 +29,30 @@
 const int _UTF8_FIRST_BYTE_BOUND_EXCL = 0xfe;
 const int _UTF8_SUBSEQUENT_BYTE_BASE = 0x80;
 
-/**
- * Decodes the UTF-8 bytes as an iterable. Thus, the consumer can only convert
- * as much of the input as needed. Set the replacementCharacter to null to
- * throw an ArgumentError rather than replace the bad value.
- */
+/// Decodes the UTF-8 bytes as an iterable. Thus, the consumer can only convert
+/// as much of the input as needed. Set the replacementCharacter to null to
+/// throw an ArgumentError rather than replace the bad value.
 IterableUtf8Decoder decodeUtf8AsIterable(List<int> bytes,
     [int offset = 0,
     int length,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  return new IterableUtf8Decoder(bytes, offset, length, replacementCodepoint);
+  return IterableUtf8Decoder(bytes, offset, length, replacementCodepoint);
 }
 
-/**
- * Produce a String from a List of UTF-8 encoded bytes. The parameters
- * can set an offset into a list of bytes (as int), limit the length of the
- * values to be decoded, and override the default Unicode replacement character.
- * Set the replacementCharacter to null to throw an ArgumentError
- * rather than replace the bad value.
- */
+/// Produce a String from a List of UTF-8 encoded bytes. The parameters
+/// can set an offset into a list of bytes (as int), limit the length of the
+/// values to be decoded, and override the default Unicode replacement character.
+/// Set the replacementCharacter to null to throw an ArgumentError
+/// rather than replace the bad value.
 String decodeUtf8(List<int> bytes,
     [int offset = 0,
     int length,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  return new String.fromCharCodes(
-      (new Utf8Decoder(bytes, offset, length, replacementCodepoint))
-          .decodeRest());
+  return String.fromCharCodes(
+      (Utf8Decoder(bytes, offset, length, replacementCodepoint)).decodeRest());
 }
 
-/**
- * Produce a sequence of UTF-8 encoded bytes from the provided string.
- */
+/// Produce a sequence of UTF-8 encoded bytes from the provided string.
 List<int> encodeUtf8(String str) => codepointsToUtf8(stringToCodepoints(str));
 
 int _addToEncoding(int offset, int bytes, int value, List<int> buffer) {
@@ -72,11 +65,9 @@
   return value;
 }
 
-/**
- * Encode code points as UTF-8 code units.
- */
+/// Encode code points as UTF-8 code units.
 List<int> codepointsToUtf8(List<int> codepoints, [int offset = 0, int length]) {
-  ListRange source = new ListRange(codepoints, offset, length);
+  ListRange source = ListRange(codepoints, offset, length);
 
   int encodedLength = 0;
   for (int value in source) {
@@ -93,7 +84,7 @@
     }
   }
 
-  List<int> encoded = new List<int>(encodedLength);
+  List<int> encoded = List<int>(encodedLength);
   int insertAt = 0;
   for (int value in source) {
     if (value < 0 || value > UNICODE_VALID_RANGE_MAX) {
@@ -128,15 +119,13 @@
     [int offset = 0,
     int length,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  return new Utf8Decoder(utf8EncodedBytes, offset, length, replacementCodepoint)
+  return Utf8Decoder(utf8EncodedBytes, offset, length, replacementCodepoint)
       .decodeRest();
 }
 
-/**
- * Return type of [decodeUtf8AsIterable] and variants. The Iterable type
- * provides an iterator on demand and the iterator will only translate bytes
- * as requested by the user of the iterator. (Note: results are not cached.)
- */
+/// Return type of [decodeUtf8AsIterable] and variants. The Iterable type
+/// provides an iterator on demand and the iterator will only translate bytes
+/// as requested by the user of the iterator. (Note: results are not cached.)
 // TODO(floitsch): Consider removing the extend and switch to implements since
 // that's cheaper to allocate.
 class IterableUtf8Decoder extends IterableBase<int> {
@@ -151,17 +140,15 @@
       this.replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]);
 
   Utf8Decoder get iterator =>
-      new Utf8Decoder(bytes, offset, length, replacementCodepoint);
+      Utf8Decoder(bytes, offset, length, replacementCodepoint);
 }
 
-/**
- * Provides an iterator of Unicode codepoints from UTF-8 encoded bytes. The
- * parameters can set an offset into a list of bytes (as int), limit the length
- * of the values to be decoded, and override the default Unicode replacement
- * character. Set the replacementCharacter to null to throw an
- * ArgumentError rather than replace the bad value. The return value
- * from this method can be used as an Iterable (e.g. in a for-loop).
- */
+/// Provides an iterator of Unicode codepoints from UTF-8 encoded bytes. The
+/// parameters can set an offset into a list of bytes (as int), limit the length
+/// of the values to be decoded, and override the default Unicode replacement
+/// character. Set the replacementCharacter to null to throw an
+/// ArgumentError rather than replace the bad value. The return value
+/// from this method can be used as an Iterable (e.g. in a for-loop).
 class Utf8Decoder implements Iterator<int> {
   // TODO(kevmoo): should this field be private?
   final ListRangeIterator utf8EncodedBytesIterator;
@@ -173,17 +160,16 @@
       int length,
       this.replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT])
       : utf8EncodedBytesIterator =
-            (new ListRange(utf8EncodedBytes, offset, length)).iterator;
+            (ListRange(utf8EncodedBytes, offset, length)).iterator;
 
   Utf8Decoder._fromListRangeIterator(ListRange source,
       [this.replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT])
       : utf8EncodedBytesIterator = source.iterator;
 
-  /** Decode the remaininder of the characters in this decoder
-    * into a [List<int>].
-    */
+  // Decode the remaininder of the characters in this decoder
+  //into a [List<int>].
   List<int> decodeRest() {
-    List<int> codepoints = new List<int>(utf8EncodedBytesIterator.remaining);
+    List<int> codepoints = List<int>(utf8EncodedBytesIterator.remaining);
     int i = 0;
     while (moveNext()) {
       codepoints[i++] = current;
@@ -191,7 +177,7 @@
     if (i == codepoints.length) {
       return codepoints;
     } else {
-      List<int> truncCodepoints = new List<int>(i);
+      List<int> truncCodepoints = List<int>(i);
       truncCodepoints.setRange(0, i, codepoints);
       return truncCodepoints;
     }
@@ -212,7 +198,7 @@
         _current = replacementCodepoint;
         return true;
       } else {
-        throw new ArgumentError(
+        throw ArgumentError(
             "Invalid UTF8 at ${utf8EncodedBytesIterator.position}");
       }
     } else if (value <= _UTF8_ONE_BYTE_MAX) {
@@ -223,7 +209,7 @@
         _current = replacementCodepoint;
         return true;
       } else {
-        throw new ArgumentError(
+        throw ArgumentError(
             "Invalid UTF8 at ${utf8EncodedBytesIterator.position}");
       }
     } else if (value < _UTF8_FIRST_BYTE_OF_THREE_BASE) {
@@ -245,7 +231,7 @@
       _current = replacementCodepoint;
       return true;
     } else {
-      throw new ArgumentError(
+      throw ArgumentError(
           "Invalid UTF8 at ${utf8EncodedBytesIterator.position}");
     }
     int j = 0;
@@ -277,7 +263,7 @@
       _current = replacementCodepoint;
       return true;
     } else {
-      throw new ArgumentError(
+      throw ArgumentError(
           "Invalid UTF8 at ${utf8EncodedBytesIterator.position - j}");
     }
   }
diff --git a/lib/src/utf_16_code_unit_decoder.dart b/lib/src/utf_16_code_unit_decoder.dart
index 28c150e..771baf8 100644
--- a/lib/src/utf_16_code_unit_decoder.dart
+++ b/lib/src/utf_16_code_unit_decoder.dart
@@ -7,12 +7,10 @@
 import 'constants.dart';
 import 'list_range.dart';
 
-/**
- * An Iterator<int> of codepoints built on an Iterator of UTF-16 code units.
- * The parameters can override the default Unicode replacement character. Set
- * the replacementCharacter to null to throw an ArgumentError
- * rather than replace the bad value.
- */
+/// An Iterator<int> of codepoints built on an Iterator of UTF-16 code units.
+/// The parameters can override the default Unicode replacement character. Set
+/// the replacementCharacter to null to throw an ArgumentError
+/// rather than replace the bad value.
 class Utf16CodeUnitDecoder implements Iterator<int> {
   // TODO(kevmoo): should this field be private?
   final ListRangeIterator utf16CodeUnitIterator;
@@ -24,7 +22,7 @@
       int length,
       this.replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT])
       : utf16CodeUnitIterator =
-            (new ListRange(utf16CodeUnits, offset, length)).iterator;
+            (ListRange(utf16CodeUnits, offset, length)).iterator;
 
   Utf16CodeUnitDecoder.fromListRangeIterator(
       this.utf16CodeUnitIterator, this.replacementCodepoint);
@@ -42,7 +40,7 @@
       if (replacementCodepoint != null) {
         _current = replacementCodepoint;
       } else {
-        throw new ArgumentError(
+        throw ArgumentError(
             "Invalid UTF16 at ${utf16CodeUnitIterator.position}");
       }
     } else if (value < UNICODE_UTF16_RESERVED_LO ||
@@ -67,15 +65,14 @@
         if (replacementCodepoint != null) {
           _current = replacementCodepoint;
         } else {
-          throw new ArgumentError(
+          throw ArgumentError(
               "Invalid UTF16 at ${utf16CodeUnitIterator.position}");
         }
       }
     } else if (replacementCodepoint != null) {
       _current = replacementCodepoint;
     } else {
-      throw new ArgumentError(
-          "Invalid UTF16 at ${utf16CodeUnitIterator.position}");
+      throw ArgumentError("Invalid UTF16 at ${utf16CodeUnitIterator.position}");
     }
     return true;
   }
diff --git a/lib/src/utf_stream.dart b/lib/src/utf_stream.dart
index 7f7cd52..1b4ca9b 100644
--- a/lib/src/utf_stream.dart
+++ b/lib/src/utf_stream.dart
@@ -21,10 +21,9 @@
   _StringDecoder(this._replacementChar);
 
   Stream<String> bind(Stream<List<int>> stream) {
-    return new Stream<String>.eventTransformed(stream,
-        (EventSink<String> sink) {
+    return Stream<String>.eventTransformed(stream, (EventSink<String> sink) {
       if (_outSink != null) {
-        throw new StateError("String decoder already used");
+        throw StateError("String decoder already used");
       }
       _outSink = sink;
       return this;
@@ -73,9 +72,9 @@
           goodChars = _buffer.length;
         }
       }
-      if (_buffer.length > 0) {
+      if (_buffer.isNotEmpty) {
         // Limit to 'goodChars', if lower than actual charCodes in the buffer.
-        _outSink.add(new String.fromCharCodes(_buffer));
+        _outSink.add(String.fromCharCodes(_buffer));
       }
       _buffer = null;
     } catch (e, stackTrace) {
@@ -90,10 +89,10 @@
   void close() {
     if (_carry != null) {
       if (_replacementChar != null) {
-        _outSink.add(new String.fromCharCodes(
-            new List.filled(_carry.length, _replacementChar)));
+        _outSink.add(
+            String.fromCharCodes(List.filled(_carry.length, _replacementChar)));
       } else {
-        throw new ArgumentError('Invalid codepoint');
+        throw ArgumentError('Invalid codepoint');
       }
     }
     _outSink.close();
@@ -106,7 +105,7 @@
       if (_replacementChar != null) {
         char = _replacementChar;
       } else {
-        throw new ArgumentError('Invalid codepoint');
+        throw ArgumentError('Invalid codepoint');
       }
     }
 
@@ -117,9 +116,7 @@
   }
 }
 
-/**
- * StringTransformer that decodes a stream of UTF-8 encoded bytes.
- */
+/// StringTransformer that decodes a stream of UTF-8 encoded bytes.
 class Utf8DecoderTransformer extends _StringDecoder {
   Utf8DecoderTransformer(
       [int replacementChar = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT])
@@ -183,10 +180,10 @@
   EventSink<List<int>> _outSink;
 
   Stream<List<int>> bind(Stream<String> stream) {
-    return new Stream<List<int>>.eventTransformed(stream,
+    return Stream<List<int>>.eventTransformed(stream,
         (EventSink<List<int>> sink) {
       if (_outSink != null) {
-        throw new StateError("String encoder already used");
+        throw StateError("String encoder already used");
       }
       _outSink = sink;
       return this;
@@ -208,9 +205,7 @@
   List<int> _processString(String string);
 }
 
-/**
- * StringTransformer that UTF-8 encodes a stream of strings.
- */
+/// StringTransformer that UTF-8 encodes a stream of strings.
 class Utf8EncoderTransformer extends _StringEncoder {
   List<int> _processString(String string) {
     var bytes = <int>[];
diff --git a/lib/src/util.dart b/lib/src/util.dart
index f94f576..135070c 100644
--- a/lib/src/util.dart
+++ b/lib/src/util.dart
@@ -8,18 +8,16 @@
 import 'list_range.dart';
 import 'utf_16_code_unit_decoder.dart';
 
-/**
- * Decodes the utf16 codeunits to codepoints.
- */
+/// Decodes the utf16 codeunits to codepoints.
 List<int> utf16CodeUnitsToCodepoints(List<int> utf16CodeUnits,
     [int offset = 0,
     int length,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
   ListRangeIterator source =
-      (new ListRange(utf16CodeUnits, offset, length)).iterator;
-  Utf16CodeUnitDecoder decoder = new Utf16CodeUnitDecoder.fromListRangeIterator(
-      source, replacementCodepoint);
-  List<int> codepoints = new List<int>(source.remaining);
+      (ListRange(utf16CodeUnits, offset, length)).iterator;
+  Utf16CodeUnitDecoder decoder =
+      Utf16CodeUnitDecoder.fromListRangeIterator(source, replacementCodepoint);
+  List<int> codepoints = List<int>(source.remaining);
   int i = 0;
   while (decoder.moveNext()) {
     codepoints[i++] = decoder.current;
@@ -27,20 +25,18 @@
   if (i == codepoints.length) {
     return codepoints;
   } else {
-    List<int> codepointTrunc = new List<int>(i);
+    List<int> codepointTrunc = List<int>(i);
     codepointTrunc.setRange(0, i, codepoints);
     return codepointTrunc;
   }
 }
 
-/**
- * Encode code points as UTF16 code units.
- */
+/// Encode code points as UTF16 code units.
 List<int> codepointsToUtf16CodeUnits(List<int> codepoints,
     [int offset = 0,
     int length,
     int replacementCodepoint = UNICODE_REPLACEMENT_CHARACTER_CODEPOINT]) {
-  ListRange listRange = new ListRange(codepoints, offset, length);
+  ListRange listRange = ListRange(codepoints, offset, length);
   int encodedLength = 0;
   for (int value in listRange) {
     if ((value >= 0 && value < UNICODE_UTF16_RESERVED_LO) ||
@@ -54,7 +50,7 @@
     }
   }
 
-  List<int> codeUnitsBuffer = new List<int>(encodedLength);
+  List<int> codeUnitsBuffer = List<int>(encodedLength);
   int j = 0;
   for (int value in listRange) {
     if ((value >= 0 && value < UNICODE_UTF16_RESERVED_LO) ||
@@ -70,7 +66,7 @@
     } else if (replacementCodepoint != null) {
       codeUnitsBuffer[j++] = replacementCodepoint;
     } else {
-      throw new ArgumentError("Invalid encoding");
+      throw ArgumentError("Invalid encoding");
     }
   }
   return codeUnitsBuffer;
diff --git a/lib/utf.dart b/lib/utf.dart
index 671e17c..d871ce2 100644
--- a/lib/utf.dart
+++ b/lib/utf.dart
@@ -2,10 +2,8 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-/**
- * Support for encoding and decoding Unicode characters in UTF-8, UTF-16, and
- * UTF-32.
- */
+/// Support for encoding and decoding Unicode characters in UTF-8, UTF-16, and
+/// UTF-32.
 library utf;
 
 export 'src/constants.dart';
diff --git a/pubspec.yaml b/pubspec.yaml
index ef3177d..a0c97d6 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -10,3 +10,4 @@
 
 dev_dependencies:
   test: ^1.2.0
+  pedantic: ^1.8.0
diff --git a/test/utf16_test.dart b/test/utf16_test.dart
index 3fe3310..7d61d21 100755
--- a/test/utf16_test.dart
+++ b/test/utf16_test.dart
@@ -16,7 +16,7 @@
 
 const String testHanWater = "水";
 
-const List<int> testKoreanCharSubsetUtf16beBom = const <int>[
+const List<int> testKoreanCharSubsetUtf16beBom = <int>[
   0xfe, 0xff, 0xac, 0x00, 0xac, 0x01, 0xac, 0x02, // 8
   0xac, 0x03, 0xac, 0x04, 0xac, 0x05, 0xac, 0x06,
   0xac, 0x07, 0xac, 0x08, 0xac, 0x09, 0xac, 0x0a,
@@ -41,7 +41,7 @@
   0xac, 0x51, 0xac, 0x52, 0xac, 0x53
 ];
 
-const List<int> testKoreanCharSubsetUtf16le = const <int>[
+const List<int> testKoreanCharSubsetUtf16le = <int>[
   0x00, 0xac, 0x01, 0xac, 0x02, 0xac, 0x03, 0xac, // 8
   0x04, 0xac, 0x05, 0xac, 0x06, 0xac, 0x07, 0xac,
   0x08, 0xac, 0x09, 0xac, 0x0a, 0xac, 0x0b, 0xac,
@@ -115,20 +115,20 @@
   expect.equals(testKoreanCharSubset.codeUnits[0], koreanDecoder.first);
   // get the whole translation using the Iterable interface
   expect.stringEquals(testKoreanCharSubset,
-      new String.fromCharCodes(new List<int>.from(koreanDecoder)));
+      String.fromCharCodes(List<int>.from(koreanDecoder)));
 
   // specify types
   expect.equals(
       44032,
-      (new List<int>.from(
+      (List<int>.from(
           decodeUtf16beAsIterable(testKoreanCharSubsetUtf16beBom)))[0]);
   expect.equals(
       44032,
-      (new List<int>.from(
+      (List<int>.from(
           decodeUtf16leAsIterable(testKoreanCharSubsetUtf16le)))[0]);
   bool stripBom = false;
   expect.equals(
       UNICODE_BOM,
-      (new List<int>.from(decodeUtf16beAsIterable(
+      (List<int>.from(decodeUtf16beAsIterable(
           testKoreanCharSubsetUtf16beBom, 0, null, stripBom)))[0]);
 }
diff --git a/test/utf32_test.dart b/test/utf32_test.dart
index e277421..47bc393 100755
--- a/test/utf32_test.dart
+++ b/test/utf32_test.dart
@@ -16,7 +16,7 @@
 
 const String testHanTwice = "二";
 
-const List<int> testKoreanCharSubsetUtf32beBom = const <int>[
+const List<int> testKoreanCharSubsetUtf32beBom = <int>[
   0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xac, 0x00, // 8
   0x00, 0x00, 0xac, 0x01, 0x00, 0x00, 0xac, 0x02,
   0x00, 0x00, 0xac, 0x03, 0x00, 0x00, 0xac, 0x04,
@@ -63,7 +63,7 @@
   0x00, 0x00, 0xac, 0x53
 ];
 
-const List<int> testKoreanCharSubsetUtf32le = const <int>[
+const List<int> testKoreanCharSubsetUtf32le = <int>[
   0x00, 0xac, 0x00, 0x00, 0x01, 0xac, 0x00, 0x00, // 8
   0x02, 0xac, 0x00, 0x00, 0x03, 0xac, 0x00, 0x00,
   0x04, 0xac, 0x00, 0x00, 0x05, 0xac, 0x00, 0x00,
@@ -164,20 +164,20 @@
   expect.equals(testKoreanCharSubset.codeUnits[0], koreanDecoder.first);
   // get the whole translation using the Iterable interface
   expect.stringEquals(testKoreanCharSubset,
-      new String.fromCharCodes(new List<int>.from(koreanDecoder)));
+      String.fromCharCodes(List<int>.from(koreanDecoder)));
 
   // specify types
   expect.equals(
       44032,
-      (new List<int>.from(
+      (List<int>.from(
           decodeUtf32beAsIterable(testKoreanCharSubsetUtf32beBom)))[0]);
   expect.equals(
       44032,
-      (new List<int>.from(
+      (List<int>.from(
           decodeUtf32leAsIterable(testKoreanCharSubsetUtf32le)))[0]);
   bool stripBom = false;
   expect.equals(
       UNICODE_BOM,
-      (new List<int>.from(decodeUtf32beAsIterable(
+      (List<int>.from(decodeUtf32beAsIterable(
           testKoreanCharSubsetUtf32beBom, 0, null, stripBom)))[0]);
 }
diff --git a/test/utf82_test.dart b/test/utf82_test.dart
index 9311e45..378ea15 100755
--- a/test/utf82_test.dart
+++ b/test/utf82_test.dart
@@ -11,7 +11,7 @@
 
 const String testEnglishPhrase = "The quick brown fox jumps over the lazy dog.";
 
-const List<int> testEnglishUtf8 = const <int>[
+const List<int> testEnglishUtf8 = <int>[
   0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63, // 8
   0x6b, 0x20, 0x62, 0x72, 0x6f, 0x77, 0x6e, 0x20,
   0x66, 0x6f, 0x78, 0x20, 0x6a, 0x75, 0x6d, 0x70,
@@ -23,7 +23,7 @@
 const String testDanishPhrase = "Quizdeltagerne spiste jordbær med "
     "fløde mens cirkusklovnen Wolther spillede på xylofon.";
 
-const List<int> testDanishUtf8 = const <int>[
+const List<int> testDanishUtf8 = <int>[
   0x51, 0x75, 0x69, 0x7a, 0x64, 0x65, 0x6c, 0x74, // 8
   0x61, 0x67, 0x65, 0x72, 0x6e, 0x65, 0x20, 0x73,
   0x70, 0x69, 0x73, 0x74, 0x65, 0x20, 0x6a, 0x6f,
@@ -42,7 +42,7 @@
 const String testHebrewPhrase =
     "דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה";
 
-const List<int> testHebrewUtf8 = const <int>[
+const List<int> testHebrewUtf8 = <int>[
   0xd7, 0x93, 0xd7, 0x92, 0x20, 0xd7, 0xa1, 0xd7, // 8
   0xa7, 0xd7, 0xa8, 0xd7, 0x9f, 0x20, 0xd7, 0xa9,
   0xd7, 0x98, 0x20, 0xd7, 0x91, 0xd7, 0x99, 0xd7,
@@ -60,7 +60,7 @@
 const String testRussianPhrase = "Съешь же ещё этих мягких "
     "французских булок да выпей чаю";
 
-const List<int> testRussianUtf8 = const <int>[
+const List<int> testRussianUtf8 = <int>[
   0xd0, 0xa1, 0xd1, 0x8a, 0xd0, 0xb5, 0xd1, 0x88, // 8
   0xd1, 0x8c, 0x20, 0xd0, 0xb6, 0xd0, 0xb5, 0x20,
   0xd0, 0xb5, 0xd1, 0x89, 0xd1, 0x91, 0x20, 0xd1,
@@ -79,7 +79,7 @@
 const String testGreekPhrase = "Γαζέες καὶ μυρτιὲς δὲν θὰ βρῶ πιὰ "
     "στὸ χρυσαφὶ ξέφωτο";
 
-const List<int> testGreekUtf8 = const <int>[
+const List<int> testGreekUtf8 = <int>[
   0xce, 0x93, 0xce, 0xb1, 0xce, 0xb6, 0xce, 0xad, // 8
   0xce, 0xb5, 0xcf, 0x82, 0x20, 0xce, 0xba, 0xce,
   0xb1, 0xe1, 0xbd, 0xb6, 0x20, 0xce, 0xbc, 0xcf,
@@ -99,7 +99,7 @@
 イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム
 ウヰノオクヤマ ケフコエテ アサキユメミシ ヱヒモセスン""";
 
-const List<int> testKatakanaUtf8 = const <int>[
+const List<int> testKatakanaUtf8 = <int>[
   0xe3, 0x82, 0xa4, 0xe3, 0x83, 0xad, 0xe3, 0x83, // 8
   0x8f, 0xe3, 0x83, 0x8b, 0xe3, 0x83, 0x9b, 0xe3,
   0x83, 0x98, 0xe3, 0x83, 0x88, 0x20, 0xe3, 0x83,
@@ -454,13 +454,13 @@
   // get the first character
   expect.equals(testEnglishUtf8[0], englishDecoder.first);
   // get the whole translation using the Iterable interface
-  expect.stringEquals(testEnglishPhrase,
-      new String.fromCharCodes(new List<int>.from(englishDecoder)));
+  expect.stringEquals(
+      testEnglishPhrase, String.fromCharCodes(List<int>.from(englishDecoder)));
 
   IterableUtf8Decoder kataDecoder = decodeUtf8AsIterable(testKatakanaUtf8);
   // get the first character
   expect.equals(testKatakanaPhrase.codeUnits[0], kataDecoder.first);
   // get the whole translation using the Iterable interface
-  expect.stringEquals(testKatakanaPhrase,
-      new String.fromCharCodes(new List<int>.from(kataDecoder)));
+  expect.stringEquals(
+      testKatakanaPhrase, String.fromCharCodes(List<int>.from(kataDecoder)));
 }
diff --git a/test/utf_test.dart b/test/utf_test.dart
index d86a383..504fb2e 100644
--- a/test/utf_test.dart
+++ b/test/utf_test.dart
@@ -11,7 +11,7 @@
 
 main() {
   test('utf', () {
-    String str = new String.fromCharCodes([0x1d537]);
+    String str = String.fromCharCodes([0x1d537]);
     // String.codeUnits gives 16-bit code units, but stringToCodepoints gives
     // back the original code points.
     expect.listEquals([0xd835, 0xdd37], str.codeUnits);