diff options
author | Mark Erickson <merickson@apache.org> | 2016-12-13 22:20:03 -0600 |
---|---|---|
committer | Mark Erickson <merickson@apache.org> | 2016-12-13 22:20:03 -0600 |
commit | 0d9b713b173f35ce02552b2f4372899440a99b25 (patch) | |
tree | c623e305a4c461af5d036c9293a0776647a6ec94 /lib/dart | |
parent | 60611917cf309d2a25b9cd8f8b5631784b07323d (diff) | |
download | thrift-0d9b713b173f35ce02552b2f4372899440a99b25.tar.gz |
THRIFT-3981 Enable analyzer strong mode in Dart library
Client: Dart
Patch: Mark Erickson <merickson@apache.org>
This closes #1135
Diffstat (limited to 'lib/dart')
-rw-r--r-- | lib/dart/.analysis_options | 2 | ||||
-rw-r--r-- | lib/dart/lib/src/transport/t_http_transport.dart | 2 | ||||
-rw-r--r-- | lib/dart/lib/src/transport/t_socket_transport.dart | 4 | ||||
-rw-r--r-- | lib/dart/pubspec.yaml | 23 | ||||
-rw-r--r-- | lib/dart/test/serializer/serializer_test_data.dart | 4 |
5 files changed, 22 insertions, 13 deletions
diff --git a/lib/dart/.analysis_options b/lib/dart/.analysis_options new file mode 100644 index 000000000..a10d4c5a0 --- /dev/null +++ b/lib/dart/.analysis_options @@ -0,0 +1,2 @@ +analyzer: + strong-mode: true diff --git a/lib/dart/lib/src/transport/t_http_transport.dart b/lib/dart/lib/src/transport/t_http_transport.dart index bd821f444..aa78e9c15 100644 --- a/lib/dart/lib/src/transport/t_http_transport.dart +++ b/lib/dart/lib/src/transport/t_http_transport.dart @@ -75,7 +75,7 @@ class THttpConfig { final Uri url; Map<String, String> _headers; - get headers => _headers; + Map<String, String> get headers => _headers; THttpConfig(this.url, Map<String, String> headers) { if (url == null || !url.hasAuthority) { diff --git a/lib/dart/lib/src/transport/t_socket_transport.dart b/lib/dart/lib/src/transport/t_socket_transport.dart index 824260d1e..8dcdfdefc 100644 --- a/lib/dart/lib/src/transport/t_socket_transport.dart +++ b/lib/dart/lib/src/transport/t_socket_transport.dart @@ -76,7 +76,7 @@ class TClientSocketTransport extends TSocketTransport { // Use a sync completer to ensure that the buffer can be read immediately // after the read buffer is set, and avoid a race condition where another // response could overwrite the read buffer. - Completer completer = new Completer.sync(); + var completer = new Completer<Uint8List>.sync(); _completers.add(completer); socket.send(bytes); @@ -123,7 +123,7 @@ class TAsyncClientSocketTransport extends TSocketTransport { // Use a sync completer to ensure that the buffer can be read immediately // after the read buffer is set, and avoid a race condition where another // response could overwrite the read buffer. - Completer completer = new Completer.sync(); + var completer = new Completer<Uint8List>.sync(); _completers[seqid] = completer; if (responseTimeout != null) { diff --git a/lib/dart/pubspec.yaml b/lib/dart/pubspec.yaml index 53f5450f2..f7aa8768a 100644 --- a/lib/dart/pubspec.yaml +++ b/lib/dart/pubspec.yaml @@ -22,15 +22,22 @@ description: > author: Apache Thrift Developers <dev@thrift.apache.org> homepage: http://thrift.apache.org documentation: http://thrift.apache.org + environment: sdk: ">=1.13.0 <2.0.0" + dependencies: - fixnum: "^0.10.2" - http: "^0.11.3" - logging: "^0.11.0" + fixnum: ^0.10.2 + http: ^0.11.3 + logging: ^0.11.0 + dev_dependencies: - coverage: "^0.7.2" - dart_dev: "^1.0.1" - dart_style: "^0.2.0" - mockito: "^0.11.0" - test: "^0.12.0" + # test + mockito: ^1.0.0 + test: ^0.12.0 + + # dart_dev - https://github.com/Workiva/dart_dev + dart_dev: ^1.5.0 + coverage: ^0.7.3 + dart_style: ">=0.2.4 <0.3.0" + dartdoc: ^0.9.0 diff --git a/lib/dart/test/serializer/serializer_test_data.dart b/lib/dart/test/serializer/serializer_test_data.dart index f957e3d69..3586f08fc 100644 --- a/lib/dart/test/serializer/serializer_test_data.dart +++ b/lib/dart/test/serializer/serializer_test_data.dart @@ -163,7 +163,7 @@ class TestTObject implements TBase { if (value == null) { unsetL(); } else { - this.l = value; + this.l = value as List<String>; } break; @@ -339,4 +339,4 @@ class TestTObject implements TBase { // check that fields of type enum have valid values } -}
\ No newline at end of file +} |