You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2020/01/07 08:30:09 UTC

[httpcomponents-client] branch master updated: HttpByteArrayCacheEntrySerializer minor code cleanup for HTTPCORE-615.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new a8fc99f  HttpByteArrayCacheEntrySerializer minor code cleanup for HTTPCORE-615.
a8fc99f is described below

commit a8fc99f4a2bcd2c54034dbac935d7937733f822a
Author: Scott Gifford <sg...@amazon.com>
AuthorDate: Sun Jan 5 17:19:01 2020 -0500

    HttpByteArrayCacheEntrySerializer minor code cleanup for HTTPCORE-615.
    
    MemcachedCacheEntryHttp inner class NoAgeCacheValidityPolicy should be static.
    Add missing javadoc @param and @return entries to MemcachedCacheEntryHttp.
    Remove extra blank lines.
---
 .../http/impl/cache/HttpByteArrayCacheEntrySerializer.java    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/HttpByteArrayCacheEntrySerializer.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/HttpByteArrayCacheEntrySerializer.java
index d5b77fd..e5b8eb4 100644
--- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/HttpByteArrayCacheEntrySerializer.java
+++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/HttpByteArrayCacheEntrySerializer.java
@@ -183,6 +183,9 @@ public class HttpByteArrayCacheEntrySerializer implements HttpCacheEntrySerializ
      * Helper method to make a new HTTP response writer.
      * <p>
      * Useful to override for testing.
+     *
+     * @param outputBuffer Output buffer to write to
+     * @return HTTP response writer to write to
      */
     protected AbstractMessageWriter<SimpleHttpResponse> makeHttpResponseWriter(final SessionOutputBuffer outputBuffer) {
         return new SimpleHttpResponseWriter();
@@ -192,6 +195,9 @@ public class HttpByteArrayCacheEntrySerializer implements HttpCacheEntrySerializ
      * Helper method to make a new ByteArrayInputStream.
      * <p>
      * Useful to override for testing.
+     *
+     * @param bytes Bytes to read from the stream
+     * @return Stream to read the bytes from
      */
     protected InputStream makeByteArrayInputStream(final byte[] bytes) {
         return new ByteArrayInputStream(bytes);
@@ -201,6 +207,8 @@ public class HttpByteArrayCacheEntrySerializer implements HttpCacheEntrySerializ
      * Helper method to make a new HTTP Response parser.
      * <p>
      * Useful to override for testing.
+     *
+     * @return HTTP response parser
      */
     protected AbstractMessageParser<ClassicHttpResponse> makeHttpResponseParser() {
         return new DefaultHttpResponseParser();
@@ -322,7 +330,6 @@ public class HttpByteArrayCacheEntrySerializer implements HttpCacheEntrySerializ
         return Boolean.parseBoolean(getOptionalCachePseudoHeaderAndRemove(response, name));
     }
 
-
     /**
      * Get the variant map metadata pseudo-header, and remove it from the response object.
      *
@@ -400,7 +407,7 @@ public class HttpByteArrayCacheEntrySerializer implements HttpCacheEntrySerializ
      * This prevents the Age header from being written to the cache (it does not make sense to cache it),
      * and is the only thing the policy is used for in this case.
      */
-    private class NoAgeCacheValidityPolicy extends CacheValidityPolicy {
+    private static class NoAgeCacheValidityPolicy extends CacheValidityPolicy {
         @Override
         public long getCurrentAgeSecs(final HttpCacheEntry entry, final Date now) {
             return 0L;