You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2020/07/10 12:57:35 UTC
[httpcomponents-client] branch master updated: BasicExpiresHandler
is annotated as immutable but is not. (#240)
This is an automated email from the ASF dual-hosted git repository.
ggregory 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 66f8ca1 BasicExpiresHandler is annotated as immutable but is not. (#240)
66f8ca1 is described below
commit 66f8ca1f09213c7108229cc546350ca2b4768774
Author: Gary Gregory <ga...@users.noreply.github.com>
AuthorDate: Fri Jul 10 08:57:24 2020 -0400
BasicExpiresHandler is annotated as immutable but is not. (#240)
---
.../hc/client5/http/impl/cookie/BasicExpiresHandler.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/BasicExpiresHandler.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/BasicExpiresHandler.java
index 1c01784..25d3385 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/BasicExpiresHandler.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/BasicExpiresHandler.java
@@ -46,11 +46,11 @@ import org.apache.hc.core5.util.Args;
public class BasicExpiresHandler extends AbstractCookieAttributeHandler implements CommonCookieAttributeHandler {
/** Valid date patterns */
- private final String[] datepatterns;
+ private final String[] datePatterns;
- public BasicExpiresHandler(final String[] datepatterns) {
- Args.notNull(datepatterns, "Array of date patterns");
- this.datepatterns = datepatterns;
+ public BasicExpiresHandler(final String[] datePatterns) {
+ Args.notNull(datePatterns, "Array of date patterns");
+ this.datePatterns = datePatterns.clone();
}
@Override
@@ -60,7 +60,7 @@ public class BasicExpiresHandler extends AbstractCookieAttributeHandler implemen
if (value == null) {
throw new MalformedCookieException("Missing value for 'expires' attribute");
}
- final Date expiry = DateUtils.parseDate(value, this.datepatterns);
+ final Date expiry = DateUtils.parseDate(value, this.datePatterns);
if (expiry == null) {
throw new MalformedCookieException("Invalid 'expires' attribute: "
+ value);