You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by mi...@apache.org on 2019/12/15 10:50:02 UTC

[httpcomponents-client] 11/12: Use paste tense for EntityBuilder#gzipCompressed

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

michaelo pushed a commit to branch consistency
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git

commit 8be681964c6b087c13f7bc5cc419353df6aad719
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun Dec 15 11:05:02 2019 +0100

    Use paste tense for EntityBuilder#gzipCompressed
    
    Both gzipCompressed and chunked denote a state of an entity where both
    should use consistent tenses.
---
 .../org/apache/hc/client5/http/entity/EntityBuilder.java     | 12 ++++++------
 .../org/apache/hc/client5/http/entity/TestEntityBuilder.java |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java
index 83557b0..e8768a5 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/EntityBuilder.java
@@ -72,7 +72,7 @@ public class EntityBuilder {
     private ContentType contentType;
     private String contentEncoding;
     private boolean chunked;
-    private boolean gzipCompress;
+    private boolean gzipCompressed;
 
     EntityBuilder() {
         super();
@@ -288,15 +288,15 @@ public class EntityBuilder {
     /**
      * Returns {@code true} if entity is to be GZIP compressed, {@code false} otherwise.
      */
-    public boolean isGzipCompress() {
-        return gzipCompress;
+    public boolean isGzipCompressed() {
+        return gzipCompressed;
     }
 
     /**
      * Makes entity GZIP compressed.
      */
-    public EntityBuilder gzipCompress() {
-        this.gzipCompress = true;
+    public EntityBuilder gzipCompressed() {
+        this.gzipCompressed = true;
         return this;
     }
 
@@ -328,7 +328,7 @@ public class EntityBuilder {
         } else {
             throw new IllegalStateException("No entity set");
         }
-        if (this.gzipCompress) {
+        if (this.gzipCompressed) {
             return new GzipCompressingEntity(e);
         }
         return e;
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java
index e65dcd8..9158afc 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestEntityBuilder.java
@@ -117,7 +117,7 @@ public class TestEntityBuilder {
 
     @Test
     public void testBuildGZipped() throws Exception {
-        final HttpEntity entity = EntityBuilder.create().setText("stuff").gzipCompress().build();
+        final HttpEntity entity = EntityBuilder.create().setText("stuff").gzipCompressed().build();
         Assert.assertNotNull(entity);
         Assert.assertNotNull(entity.getContentType());
         Assert.assertEquals("text/plain; charset=ISO-8859-1", entity.getContentType());