You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2019/10/17 20:39:19 UTC

[calcite-avatica] 03/03: Cosmetic

This is an automated email from the ASF dual-hosted git repository.

jhyde pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite-avatica.git

commit 73fac75befaaf3caa3871656d0d0b7adbd91f7cf
Author: Julian Hyde <jh...@apache.org>
AuthorDate: Thu Oct 17 01:42:02 2019 -0700

    Cosmetic
    
    Remove trailing whitespace, end files with a newline, add paragraph
    tags to javadoc, and move '.' operators to the beginning of lines.
---
 appveyor.yml                                       |  6 +--
 .../java/org/apache/calcite/avatica/SqlType.java   |  2 -
 .../remote/AvaticaCommonsHttpClientSpnegoImpl.java |  4 +-
 .../org/apache/calcite/avatica/remote/Service.java |  4 +-
 .../avatica/remote/ProtobufSerializationTest.java  | 56 ++++++++++++----------
 .../calcite/avatica/util/StructImplTest.java       | 17 ++++---
 docker/src/main/dockerhub/hooks/build              |  2 +-
 docker/src/main/dockerhub/hooks/post_push          |  2 +-
 .../apache/calcite/avatica/jdbc/JdbcMetaTest.java  |  4 +-
 site/_docs/history.md                              |  2 +-
 site/_docs/howto.md                                |  2 +-
 site/_docs/index.md                                |  2 +-
 site/_posts/2019-05-13-release-1.15.0.md           |  2 +-
 site/downloads/avatica-go.md                       |  2 +-
 site/downloads/avatica.md                          |  2 +-
 15 files changed, 56 insertions(+), 53 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index eb44d05..846694d 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -28,12 +28,12 @@ branches:
     - /^branch-.*$/
     - /^[0-9]+-.*$/
 matrix:
-  fast_finish: true  
+  fast_finish: true
 environment:
-  matrix:  
+  matrix:
     - JAVA_HOME: C:\Program Files\Java\jdk1.8.0
     - JAVA_HOME: C:\Program Files\Java\jdk9
-    - JAVA_HOME: C:\Program Files\Java\jdk10        
+    - JAVA_HOME: C:\Program Files\Java\jdk10
     - JAVA_HOME: C:\Program Files\Java\jdk11
 build_script:
   - mvn clean -V install -DskipTests -Dmaven.javadoc.skip=true -Djavax.net.ssl.trustStorePassword=changeit
diff --git a/core/src/main/java/org/apache/calcite/avatica/SqlType.java b/core/src/main/java/org/apache/calcite/avatica/SqlType.java
index 5111f9f..840e218 100644
--- a/core/src/main/java/org/apache/calcite/avatica/SqlType.java
+++ b/core/src/main/java/org/apache/calcite/avatica/SqlType.java
@@ -195,7 +195,6 @@ import java.util.Map;
  *
  * <p><a id="B5">TABLE B-5</a>: Conversions performed by {@code setObject} and
  * {@code setNull} between Java object types and target JDBC types
- *
  * <!--
  * CHECKSTYLE: OFF
  * -->
@@ -244,7 +243,6 @@ import java.util.Map;
  *
  * <p><a id="B6">TABLE B-6</a>: Use of {@code ResultSet} getter methods to
  * retrieve JDBC data types
- *
  * <!--
  * CHECKSTYLE: OFF
  * -->
diff --git a/core/src/main/java/org/apache/calcite/avatica/remote/AvaticaCommonsHttpClientSpnegoImpl.java b/core/src/main/java/org/apache/calcite/avatica/remote/AvaticaCommonsHttpClientSpnegoImpl.java
index 635c711..d08d36a 100644
--- a/core/src/main/java/org/apache/calcite/avatica/remote/AvaticaCommonsHttpClientSpnegoImpl.java
+++ b/core/src/main/java/org/apache/calcite/avatica/remote/AvaticaCommonsHttpClientSpnegoImpl.java
@@ -40,10 +40,12 @@ import org.slf4j.LoggerFactory;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.security.Principal;
+
 /**
  * Implementation of an AvaticaHttpClient which uses SPNEGO.
  *
- * ( at this point it could probably be just merged back into AvaticaCommonsHttpClientImpl)
+ * <p>(At this point it could probably be just merged back into
+ * {@link AvaticaCommonsHttpClientImpl}.)
  */
 public class AvaticaCommonsHttpClientSpnegoImpl extends AvaticaCommonsHttpClientImpl {
   private static final Logger LOG = LoggerFactory
diff --git a/core/src/main/java/org/apache/calcite/avatica/remote/Service.java b/core/src/main/java/org/apache/calcite/avatica/remote/Service.java
index 76e1e6b..1a5aa43 100644
--- a/core/src/main/java/org/apache/calcite/avatica/remote/Service.java
+++ b/core/src/main/java/org/apache/calcite/avatica/remote/Service.java
@@ -238,8 +238,8 @@ public interface Service {
    * {@link org.apache.calcite.avatica.Meta#getDatabaseProperties(Meta.ConnectionHandle)}. */
   class DatabasePropertyRequest extends Request {
     private static final FieldDescriptor CONNECTION_ID_DESCRIPTOR =
-        Requests.DatabasePropertyRequest.getDescriptor().
-        findFieldByNumber(Requests.DatabasePropertyRequest.CONNECTION_ID_FIELD_NUMBER);
+        Requests.DatabasePropertyRequest.getDescriptor()
+            .findFieldByNumber(Requests.DatabasePropertyRequest.CONNECTION_ID_FIELD_NUMBER);
 
     public final String connectionId;
 
diff --git a/core/src/test/java/org/apache/calcite/avatica/remote/ProtobufSerializationTest.java b/core/src/test/java/org/apache/calcite/avatica/remote/ProtobufSerializationTest.java
index 39787dd..0efcb02 100644
--- a/core/src/test/java/org/apache/calcite/avatica/remote/ProtobufSerializationTest.java
+++ b/core/src/test/java/org/apache/calcite/avatica/remote/ProtobufSerializationTest.java
@@ -96,22 +96,24 @@ public class ProtobufSerializationTest {
     final long maxRowCount = 200L;
 
     // The "current" serialization strategy.
-    Requests.PrepareRequest protoPrepare = Requests.PrepareRequest.newBuilder().
-        setConnectionId(connectionId).setSql(sql).setMaxRowsTotal(maxRowCount).build();
+    Requests.PrepareRequest protoPrepare = Requests.PrepareRequest.newBuilder()
+        .setConnectionId(connectionId).setSql(sql).setMaxRowsTotal(maxRowCount)
+        .build();
 
     Service.PrepareRequest prepareReq = new Service.PrepareRequest().deserialize(protoPrepare);
     assertEquals(maxRowCount, prepareReq.maxRowCount);
 
     // The "old" serialization strategy.
-    protoPrepare = Requests.PrepareRequest.newBuilder().
-        setConnectionId(connectionId).setSql(sql).setMaxRowCount(maxRowCount).build();
+    protoPrepare = Requests.PrepareRequest.newBuilder()
+        .setConnectionId(connectionId).setSql(sql).setMaxRowCount(maxRowCount)
+        .build();
 
     prepareReq = new Service.PrepareRequest().deserialize(protoPrepare);
     assertEquals(maxRowCount, prepareReq.maxRowCount);
 
     // Both the new and old provided should default to the new
-    protoPrepare = Requests.PrepareRequest.newBuilder().
-        setConnectionId(connectionId).setSql(sql).setMaxRowCount(500L)
+    protoPrepare = Requests.PrepareRequest.newBuilder()
+        .setConnectionId(connectionId).setSql(sql).setMaxRowCount(500L)
         .setMaxRowsTotal(maxRowCount).build();
 
     prepareReq = new Service.PrepareRequest().deserialize(protoPrepare);
@@ -162,18 +164,19 @@ public class ProtobufSerializationTest {
     final int maxRowsInFirstFrame = 50;
 
     // The "current" serialization strategy (maxRowsTotal and firstFrameMaxSize)
-    Requests.PrepareAndExecuteRequest protoPrepare = Requests.PrepareAndExecuteRequest.newBuilder().
-        setConnectionId(connectionId).setSql(sql).setMaxRowsTotal(maxRowCount).
-        setFirstFrameMaxSize(maxRowsInFirstFrame).build();
+    Requests.PrepareAndExecuteRequest protoPrepare = Requests.PrepareAndExecuteRequest.newBuilder()
+        .setConnectionId(connectionId).setSql(sql).setMaxRowsTotal(maxRowCount)
+        .setFirstFrameMaxSize(maxRowsInFirstFrame).build();
 
-    Service.PrepareAndExecuteRequest prepareAndExecuteReq = new Service.PrepareAndExecuteRequest().
-        deserialize(protoPrepare);
+    Service.PrepareAndExecuteRequest prepareAndExecuteReq = new Service.PrepareAndExecuteRequest()
+        .deserialize(protoPrepare);
     assertEquals(maxRowCount, prepareAndExecuteReq.maxRowCount);
     assertEquals(maxRowsInFirstFrame, prepareAndExecuteReq.maxRowsInFirstFrame);
 
     // The "old" serialization strategy (maxRowCount)
-    protoPrepare = Requests.PrepareAndExecuteRequest.newBuilder().
-        setConnectionId(connectionId).setSql(sql).setMaxRowCount(maxRowCount).build();
+    protoPrepare = Requests.PrepareAndExecuteRequest.newBuilder()
+        .setConnectionId(connectionId).setSql(sql).setMaxRowCount(maxRowCount)
+        .build();
 
     prepareAndExecuteReq = new Service.PrepareAndExecuteRequest().deserialize(protoPrepare);
     assertEquals(maxRowCount, prepareAndExecuteReq.maxRowCount);
@@ -182,8 +185,8 @@ public class ProtobufSerializationTest {
 
     // Both the new and old provided should default to the new (firstFrameMaxSize should be the
     // the same as what ultimately is set to maxRowCount)
-    protoPrepare = Requests.PrepareAndExecuteRequest.newBuilder().
-        setConnectionId(connectionId).setSql(sql).setMaxRowCount(500L)
+    protoPrepare = Requests.PrepareAndExecuteRequest.newBuilder()
+        .setConnectionId(connectionId).setSql(sql).setMaxRowCount(500L)
         .setMaxRowsTotal(maxRowCount).build();
 
     prepareAndExecuteReq = new Service.PrepareAndExecuteRequest().deserialize(protoPrepare);
@@ -192,8 +195,8 @@ public class ProtobufSerializationTest {
         prepareAndExecuteReq.maxRowsInFirstFrame);
 
     // Same as previous example, but explicitly setting maxRowsInFirstFrame too
-    protoPrepare = Requests.PrepareAndExecuteRequest.newBuilder().
-        setConnectionId(connectionId).setSql(sql).setMaxRowCount(500L)
+    protoPrepare = Requests.PrepareAndExecuteRequest.newBuilder()
+        .setConnectionId(connectionId).setSql(sql).setMaxRowCount(500L)
         .setMaxRowsTotal(maxRowCount).setFirstFrameMaxSize(maxRowsInFirstFrame).build();
 
     prepareAndExecuteReq = new Service.PrepareAndExecuteRequest().deserialize(protoPrepare);
@@ -225,25 +228,26 @@ public class ProtobufSerializationTest {
     final int maxSize = 200;
 
     // The "current" serialization strategy.
-    Requests.FetchRequest protoFetch = Requests.FetchRequest.newBuilder().
-        setConnectionId(connectionId).setStatementId(statementId).
-        setOffset(offset).setFrameMaxSize(maxSize).build();
+    Requests.FetchRequest protoFetch = Requests.FetchRequest.newBuilder()
+        .setConnectionId(connectionId).setStatementId(statementId)
+        .setOffset(offset).setFrameMaxSize(maxSize).build();
 
     Service.FetchRequest fetchReq = new Service.FetchRequest().deserialize(protoFetch);
     assertEquals(maxSize, fetchReq.fetchMaxRowCount);
 
     // The "old" serialization strategy.
-    protoFetch = Requests.FetchRequest.newBuilder().
-        setConnectionId(connectionId).setStatementId(statementId).
-        setOffset(offset).setFetchMaxRowCount(maxSize).build();
+    protoFetch = Requests.FetchRequest.newBuilder()
+        .setConnectionId(connectionId).setStatementId(statementId)
+        .setOffset(offset).setFetchMaxRowCount(maxSize).build();
 
     fetchReq = new Service.FetchRequest().deserialize(protoFetch);
     assertEquals(maxSize, fetchReq.fetchMaxRowCount);
 
     // Both the new and old provided should default to the new
-    protoFetch = Requests.FetchRequest.newBuilder().
-        setConnectionId(connectionId).setStatementId(statementId).
-        setOffset(offset).setFetchMaxRowCount(100).setFrameMaxSize(maxSize).build();
+    protoFetch = Requests.FetchRequest.newBuilder()
+        .setConnectionId(connectionId).setStatementId(statementId)
+        .setOffset(offset).setFetchMaxRowCount(100).setFrameMaxSize(maxSize)
+        .build();
 
     fetchReq = new Service.FetchRequest().deserialize(protoFetch);
     assertEquals(maxSize, fetchReq.fetchMaxRowCount);
diff --git a/core/src/test/java/org/apache/calcite/avatica/util/StructImplTest.java b/core/src/test/java/org/apache/calcite/avatica/util/StructImplTest.java
index 1058125..9e9fd6e 100644
--- a/core/src/test/java/org/apache/calcite/avatica/util/StructImplTest.java
+++ b/core/src/test/java/org/apache/calcite/avatica/util/StructImplTest.java
@@ -47,17 +47,20 @@ public class StructImplTest {
    */
   private static class ColumnInputBundle<T> {
     private final ColumnMetaData metaData;
+
     /**
      * The input values for the given column.
      *
-     * These values are used to construct the rows of a ResultSet.
+     * <p>These values are used to construct the rows of a ResultSet.
      */
     private final List<Object> inputValues;
+
     /**
      * The expected values for the given column.
      *
-     * These values are used to verify that the result obtained from a ResultSet is correct. Note,
-     * that inputValues and expectedValues are not necessarily equal.
+     * <p>These values are used to verify that the result obtained from a
+     * ResultSet is correct. Note that inputValues and expectedValues are not
+     * necessarily equal.
      */
     private final List<T> expectedValues;
 
@@ -88,9 +91,7 @@ public class StructImplTest {
         0,
         ColumnMetaData.struct(
             Arrays.asList(
-                MetaImpl.columnMetaData("INT", 0, int.class, false)
-            )
-        ),
+                MetaImpl.columnMetaData("INT", 0, int.class, false))),
         false);
 
     ColumnMetaData twoAttrStructMeta = MetaImpl.columnMetaData(
@@ -99,9 +100,7 @@ public class StructImplTest {
         ColumnMetaData.struct(
             Arrays.asList(
                 MetaImpl.columnMetaData("INT", 0, int.class, false),
-                MetaImpl.columnMetaData("INT", 1, int.class, false)
-            )
-        ),
+                MetaImpl.columnMetaData("INT", 1, int.class, false))),
         false);
 
     List<Struct> oneAttrStructData = new ArrayList<>(numRows);
diff --git a/docker/src/main/dockerhub/hooks/build b/docker/src/main/dockerhub/hooks/build
index cfc048d..e193f3c 100644
--- a/docker/src/main/dockerhub/hooks/build
+++ b/docker/src/main/dockerhub/hooks/build
@@ -15,4 +15,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-docker build --build-arg AVATICA_VERSION="$DOCKER_TAG" -t $IMAGE_NAME .
\ No newline at end of file
+docker build --build-arg AVATICA_VERSION="$DOCKER_TAG" -t $IMAGE_NAME .
diff --git a/docker/src/main/dockerhub/hooks/post_push b/docker/src/main/dockerhub/hooks/post_push
index c864128..affc991 100644
--- a/docker/src/main/dockerhub/hooks/post_push
+++ b/docker/src/main/dockerhub/hooks/post_push
@@ -18,4 +18,4 @@
 HSQLDB_IMAGE_NAME=apache/calcite-avatica-hypersql:$DOCKER_TAG
 
 docker build --build-arg AVATICA_VERSION="$DOCKER_TAG" -f Dockerfile.hypersql -t $HSQLDB_IMAGE_NAME .
-docker push $HSQLDB_IMAGE_NAME
\ No newline at end of file
+docker push $HSQLDB_IMAGE_NAME
diff --git a/server/src/test/java/org/apache/calcite/avatica/jdbc/JdbcMetaTest.java b/server/src/test/java/org/apache/calcite/avatica/jdbc/JdbcMetaTest.java
index f3ebc8a..494b9ab 100644
--- a/server/src/test/java/org/apache/calcite/avatica/jdbc/JdbcMetaTest.java
+++ b/server/src/test/java/org/apache/calcite/avatica/jdbc/JdbcMetaTest.java
@@ -112,8 +112,8 @@ public class JdbcMetaTest {
     Mockito.when(statementCache.getIfPresent(statementId)).thenReturn(statementInfo);
     Mockito.when(statement.getResultSet()).thenReturn(null);
     // The real methods
-    Mockito.when(meta.prepareAndExecute(statementHandle, sql, maxRows, 50, null)).
-        thenCallRealMethod();
+    Mockito.when(meta.prepareAndExecute(statementHandle, sql, maxRows, 50, null))
+        .thenCallRealMethod();
     Mockito.doCallRealMethod().when(meta).setMaxRows(statement, maxRows);
 
     // Call our method
diff --git a/site/_docs/history.md b/site/_docs/history.md
index ee6eabb..19e1150 100644
--- a/site/_docs/history.md
+++ b/site/_docs/history.md
@@ -97,7 +97,7 @@ Tests
   Update appveyor.yml to enable Appveyor testing against JDK 11
 * [<a href="https://issues.apache.org/jira/browse/CALCITE-2961">CALCITE-2961</a>]
   Enable Travis to test against JDK 13
-  
+
 Website and Documentation
 
 * Update to new git URL (switch to gitbox)
diff --git a/site/_docs/howto.md b/site/_docs/howto.md
index a3344e1..b9c0141 100644
--- a/site/_docs/howto.md
+++ b/site/_docs/howto.md
@@ -524,7 +524,7 @@ Tip: Push the git tag only after the staged nexus artifacts are promoted in the
 tag triggers Docker Hub to start building the docker images immediately and the build will pull in the promoted artifacts.
 If the artifacts are not yet available, the build on Docker Hub will fail. It's best to continue with the following steps
 after you have confirmed that the nexus artifacts were promoted properly.
- 
+
 ### Publishing directly in your environment:
 Copy the Git tag:
 
diff --git a/site/_docs/index.md b/site/_docs/index.md
index c478feb..249fcf7 100644
--- a/site/_docs/index.md
+++ b/site/_docs/index.md
@@ -180,4 +180,4 @@ highly welcomed!
 * Language: JavaScript
 * *License*: [MIT](https://opensource.org/licenses/MIT)
 * Any Avatica version
-* *Maintainer*: Waylay.io
\ No newline at end of file
+* *Maintainer*: Waylay.io
diff --git a/site/_posts/2019-05-13-release-1.15.0.md b/site/_posts/2019-05-13-release-1.15.0.md
index ea9efe8..9d944bf 100644
--- a/site/_posts/2019-05-13-release-1.15.0.md
+++ b/site/_posts/2019-05-13-release-1.15.0.md
@@ -34,4 +34,4 @@ See the list of [bug fixes and new features]({{ site.baseurl }}/docs/history.htm
 for more information.
 
 Consumers of Avatica are encouraged to skip the 1.14.0 release and upgrade directly to
-1.15.0 due to the aforementioned regression.
\ No newline at end of file
+1.15.0 due to the aforementioned regression.
diff --git a/site/downloads/avatica-go.md b/site/downloads/avatica-go.md
index 684d238..1371273 100644
--- a/site/downloads/avatica-go.md
+++ b/site/downloads/avatica-go.md
@@ -120,4 +120,4 @@ or
 {% highlight shell %}
 % pgp -ka KEYS
 % pgp downloaded_file.asc
-{% endhighlight %}
\ No newline at end of file
+{% endhighlight %}
diff --git a/site/downloads/avatica.md b/site/downloads/avatica.md
index 69f9c63..df5b85f 100644
--- a/site/downloads/avatica.md
+++ b/site/downloads/avatica.md
@@ -154,4 +154,4 @@ As of Apache Calcite Avatica 1.9.0, the following un-shaded client artifact is a
 ## Docker images
 
 From release 1.10.0 onwards, Docker images for Avatica Server are available at
-[Docker Hub](https://hub.docker.com/r/apache/calcite-avatica).
\ No newline at end of file
+[Docker Hub](https://hub.docker.com/r/apache/calcite-avatica).