WICKET-5147 comment clean up
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/a02b2b67 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/a02b2b67 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/a02b2b67 Branch: refs/heads/master Commit: a02b2b6774576e7815b8d84ac72fa759e1accb6e Parents: d9c2d40 Author: Michael Mosmann <[email protected]> Authored: Fri Apr 26 01:41:12 2013 +0200 Committer: Michael Mosmann <[email protected]> Committed: Fri Apr 26 01:41:12 2013 +0200 ---------------------------------------------------------------------- .../apache/wicket/protocol/http/mock/Cookies.java | 57 +++++++-------- 1 files changed, 27 insertions(+), 30 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/a02b2b67/wicket-core/src/main/java/org/apache/wicket/protocol/http/mock/Cookies.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/mock/Cookies.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/mock/Cookies.java index f785ecb..adc7be7 100644 --- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/mock/Cookies.java +++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/mock/Cookies.java @@ -17,15 +17,10 @@ package org.apache.wicket.protocol.http.mock; import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; import javax.servlet.http.Cookie; -import org.apache.wicket.protocol.http.mock.Cookies.Key; import org.apache.wicket.util.lang.Args; -import org.apache.wicket.util.lang.Objects; /** * A helper class for dealing with cookies @@ -36,38 +31,40 @@ public final class Cookies * Constructor. */ private Cookies() - {} + { + } /** * Make a copy of the passed cookie. - * + * * @param cookie - * The cookie to copy + * The cookie to copy * @return A copy of the passed cookie. May be {@code null} if the argument is {@code null}. */ public static Cookie copyOf(Cookie cookie) { - return cookie != null ? (Cookie) cookie.clone() : null; + return cookie != null ? (Cookie)cookie.clone() : null; } /** * creates a key based on the property for cookie equality - * @param cookie cookie + * + * @param cookie + * cookie * @return key */ public static Key keyOf(Cookie cookie) { return new Key(cookie); } - + /** - * Checks whether two cookies are equal. - * See http://www.ietf.org/rfc/rfc2109.txt, p.4.3.3 - * + * Checks whether two cookies are equal. See http://www.ietf.org/rfc/rfc2109.txt, p.4.3.3 + * * @param c1 - * the first cookie + * the first cookie * @param c2 - * the second cookie + * the second cookie * @return {@code true} only if the cookies have the same name, path and domain */ public static boolean isEqual(Cookie c1, Cookie c2) @@ -75,14 +72,12 @@ public final class Cookies Args.notNull(c1, "c1"); Args.notNull(c2, "c2"); -// return c1.getName().equals(c2.getName()) && -// Objects.isEqual(c1.getPath(), c2.getPath()) && -// Objects.isEqual(c1.getDomain(), c2.getDomain()); return new Key(c1).equals(new Key(c2)); } - + /** * detect if this cookie is expired + * * @param cookie * @return */ @@ -90,17 +85,19 @@ public final class Cookies { return cookie.getMaxAge() == 0; } - - public static class Key implements Serializable { - + + public static class Key implements Serializable + { + private final String name; private final String path; private final String domain; - protected Key(Cookie cookie) { - this.name=cookie.getName(); - this.path=cookie.getPath(); - this.domain=cookie.getDomain(); + protected Key(Cookie cookie) + { + name = cookie.getName(); + path = cookie.getPath(); + domain = cookie.getDomain(); } @Override @@ -147,13 +144,13 @@ public final class Cookies return false; return true; } - + @Override public String toString() { - return name+";"+domain+"/"+path; + return name + ";" + domain + "/" + path; } - + } }
