BasicExpiresHandler is annotated as immutable but is not. (#240)

This commit is contained in:
Gary Gregory 2020-07-10 08:57:24 -04:00 committed by GitHub
parent 9866865357
commit 66f8ca1f09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -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);