THRIFT-3981 Enable analyzer strong mode in Dart library

Client: Dart
Patch: Mark Erickson <merickson@apache.org>

This closes #1135
This commit is contained in:
Mark Erickson 2016-12-13 22:20:03 -06:00
parent 60611917cf
commit 0d9b713b17
14 changed files with 42 additions and 18 deletions

View File

@ -0,0 +1,2 @@
analyzer:
strong-mode: true

View File

@ -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) {

View File

@ -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) {

View File

@ -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

View File

@ -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
}
}
}

View File

@ -0,0 +1,2 @@
analyzer:
strong-mode: true

View File

@ -251,7 +251,7 @@ List<TTest> _createTests() {
}));
tests.add(new TTest(TEST_CONTAINERS, 'testSet', () async {
var input = new Set.from([-2, -1, 0, 1, 2]);
var input = new Set<int>.from([-2, -1, 0, 1, 2]);
var result = await client.testSet(input);
var equality = const SetEquality();
if (!equality.equals(result, input)) throw new TTestError(result, input);

View File

@ -20,8 +20,10 @@ version: 1.0.0-dev
description: A client integration test for the Dart Thrift library
author: Apache Thrift Developers <dev@thrift.apache.org>
homepage: http://thrift.apache.org
environment:
sdk: ^1.12.0
sdk: ">=1.13.0 <2.0.0"
dependencies:
args: ^0.13.0
http: ^0.11.0
@ -29,5 +31,6 @@ dependencies:
path: ../../../lib/dart
thrift_test:
path: ../gen-dart/thrift_test
dev_dependencies:
test: "^0.12.0"

View File

@ -0,0 +1,2 @@
analyzer:
strong-mode: true

View File

@ -22,7 +22,7 @@ author: Apache Thrift Developers <dev@thrift.apache.org>
homepage: http://thrift.apache.org
environment:
sdk: ^1.12.0
sdk: ">=1.13.0 <2.0.0"
dependencies:
browser: ^0.10.0

View File

@ -0,0 +1,2 @@
analyzer:
strong-mode: true

View File

@ -21,8 +21,10 @@ description: >
A Dart console client to implementation of the Apache Thrift tutorial
author: Apache Thrift Developers <dev@thrift.apache.org>
homepage: http://thrift.apache.org
environment:
sdk: ^1.12.0
sdk: ">=1.13.0 <2.0.0"
dependencies:
args: ^0.13.0
collection: ^1.1.0

View File

@ -0,0 +1,2 @@
analyzer:
strong-mode: true

View File

@ -20,8 +20,10 @@ version: 1.0.0-dev
description: A Dart server to support the Apache Thrift tutorial
author: Apache Thrift Developers <dev@thrift.apache.org>
homepage: http://thrift.apache.org
environment:
sdk: ^1.12.0
sdk: ">=1.13.0 <2.0.0"
dependencies:
args: ^0.13.0
shared: