You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jf...@apache.org on 2016/12/21 21:18:32 UTC

[17/24] thrift git commit: THRIFT-3981 Enable analyzer strong mode in Dart library Client: Dart Patch: Mark Erickson

THRIFT-3981 Enable analyzer strong mode in Dart library
Client: Dart
Patch: Mark Erickson <me...@apache.org>

This closes #1135


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/0d9b713b
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/0d9b713b
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/0d9b713b

Branch: refs/heads/0.10.0
Commit: 0d9b713b173f35ce02552b2f4372899440a99b25
Parents: 6061191
Author: Mark Erickson <me...@apache.org>
Authored: Tue Dec 13 22:20:03 2016 -0600
Committer: Mark Erickson <me...@apache.org>
Committed: Tue Dec 13 22:20:03 2016 -0600

----------------------------------------------------------------------
 lib/dart/.analysis_options                      |  2 ++
 .../lib/src/transport/t_http_transport.dart     |  2 +-
 .../lib/src/transport/t_socket_transport.dart   |  4 ++--
 lib/dart/pubspec.yaml                           | 23 +++++++++++++-------
 .../test/serializer/serializer_test_data.dart   |  4 ++--
 test/dart/test_client/.analysis_options         |  2 ++
 test/dart/test_client/bin/main.dart             |  2 +-
 test/dart/test_client/pubspec.yaml              |  5 ++++-
 tutorial/dart/client/.analysis_options          |  2 ++
 tutorial/dart/client/pubspec.yaml               |  2 +-
 tutorial/dart/console_client/.analysis_options  |  2 ++
 tutorial/dart/console_client/pubspec.yaml       |  4 +++-
 tutorial/dart/server/.analysis_options          |  2 ++
 tutorial/dart/server/pubspec.yaml               |  4 +++-
 14 files changed, 42 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/lib/dart/.analysis_options
----------------------------------------------------------------------
diff --git a/lib/dart/.analysis_options b/lib/dart/.analysis_options
new file mode 100644
index 0000000..a10d4c5
--- /dev/null
+++ b/lib/dart/.analysis_options
@@ -0,0 +1,2 @@
+analyzer:
+  strong-mode: true

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/lib/dart/lib/src/transport/t_http_transport.dart
----------------------------------------------------------------------
diff --git a/lib/dart/lib/src/transport/t_http_transport.dart b/lib/dart/lib/src/transport/t_http_transport.dart
index bd821f4..aa78e9c 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) {

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/lib/dart/lib/src/transport/t_socket_transport.dart
----------------------------------------------------------------------
diff --git a/lib/dart/lib/src/transport/t_socket_transport.dart b/lib/dart/lib/src/transport/t_socket_transport.dart
index 824260d..8dcdfde 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) {

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/lib/dart/pubspec.yaml
----------------------------------------------------------------------
diff --git a/lib/dart/pubspec.yaml b/lib/dart/pubspec.yaml
index 53f5450..f7aa876 100644
--- a/lib/dart/pubspec.yaml
+++ b/lib/dart/pubspec.yaml
@@ -22,15 +22,22 @@ description: >
 author: Apache Thrift Developers <de...@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

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/lib/dart/test/serializer/serializer_test_data.dart
----------------------------------------------------------------------
diff --git a/lib/dart/test/serializer/serializer_test_data.dart b/lib/dart/test/serializer/serializer_test_data.dart
index f957e3d..3586f08 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
+}

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/test/dart/test_client/.analysis_options
----------------------------------------------------------------------
diff --git a/test/dart/test_client/.analysis_options b/test/dart/test_client/.analysis_options
new file mode 100644
index 0000000..a10d4c5
--- /dev/null
+++ b/test/dart/test_client/.analysis_options
@@ -0,0 +1,2 @@
+analyzer:
+  strong-mode: true

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/test/dart/test_client/bin/main.dart
----------------------------------------------------------------------
diff --git a/test/dart/test_client/bin/main.dart b/test/dart/test_client/bin/main.dart
index 78a4f79..996844b 100644
--- a/test/dart/test_client/bin/main.dart
+++ b/test/dart/test_client/bin/main.dart
@@ -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);

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/test/dart/test_client/pubspec.yaml
----------------------------------------------------------------------
diff --git a/test/dart/test_client/pubspec.yaml b/test/dart/test_client/pubspec.yaml
index 493ee32..a91aa45 100644
--- a/test/dart/test_client/pubspec.yaml
+++ b/test/dart/test_client/pubspec.yaml
@@ -20,8 +20,10 @@ version: 1.0.0-dev
 description: A client integration test for the Dart Thrift library
 author: Apache Thrift Developers <de...@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"

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/tutorial/dart/client/.analysis_options
----------------------------------------------------------------------
diff --git a/tutorial/dart/client/.analysis_options b/tutorial/dart/client/.analysis_options
new file mode 100644
index 0000000..a10d4c5
--- /dev/null
+++ b/tutorial/dart/client/.analysis_options
@@ -0,0 +1,2 @@
+analyzer:
+  strong-mode: true

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/tutorial/dart/client/pubspec.yaml
----------------------------------------------------------------------
diff --git a/tutorial/dart/client/pubspec.yaml b/tutorial/dart/client/pubspec.yaml
index 4bd3394..db64afc 100644
--- a/tutorial/dart/client/pubspec.yaml
+++ b/tutorial/dart/client/pubspec.yaml
@@ -22,7 +22,7 @@ author: Apache Thrift Developers <de...@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

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/tutorial/dart/console_client/.analysis_options
----------------------------------------------------------------------
diff --git a/tutorial/dart/console_client/.analysis_options b/tutorial/dart/console_client/.analysis_options
new file mode 100644
index 0000000..a10d4c5
--- /dev/null
+++ b/tutorial/dart/console_client/.analysis_options
@@ -0,0 +1,2 @@
+analyzer:
+  strong-mode: true

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/tutorial/dart/console_client/pubspec.yaml
----------------------------------------------------------------------
diff --git a/tutorial/dart/console_client/pubspec.yaml b/tutorial/dart/console_client/pubspec.yaml
index 1423ed2..cea13ac 100644
--- a/tutorial/dart/console_client/pubspec.yaml
+++ b/tutorial/dart/console_client/pubspec.yaml
@@ -21,8 +21,10 @@ description: >
   A Dart console client to implementation of the Apache Thrift tutorial
 author: Apache Thrift Developers <de...@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

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/tutorial/dart/server/.analysis_options
----------------------------------------------------------------------
diff --git a/tutorial/dart/server/.analysis_options b/tutorial/dart/server/.analysis_options
new file mode 100644
index 0000000..a10d4c5
--- /dev/null
+++ b/tutorial/dart/server/.analysis_options
@@ -0,0 +1,2 @@
+analyzer:
+  strong-mode: true

http://git-wip-us.apache.org/repos/asf/thrift/blob/0d9b713b/tutorial/dart/server/pubspec.yaml
----------------------------------------------------------------------
diff --git a/tutorial/dart/server/pubspec.yaml b/tutorial/dart/server/pubspec.yaml
index cdb2dc7..4833a4a 100644
--- a/tutorial/dart/server/pubspec.yaml
+++ b/tutorial/dart/server/pubspec.yaml
@@ -20,8 +20,10 @@ version: 1.0.0-dev
 description: A Dart server to support the Apache Thrift tutorial
 author: Apache Thrift Developers <de...@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: