olegk 2003/02/04 12:16:27 Modified: httpclient/src/java/org/apache/commons/httpclient Cookie.java Log: - fixes the problem with Cookie#Cookie(String, String, String, String, int, boolean) constructor accepting negative "max-age" values Contributed by Oleg Kalnichevski Revision Changes Path 1.37 +9 -6 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java Index: Cookie.java =================================================================== RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- Cookie.java 31 Jan 2003 00:33:36 -0000 1.36 +++ Cookie.java 4 Feb 2003 20:16:24 -0000 1.37 @@ -167,8 +167,11 @@ public Cookie(String domain, String name, String value, String path, int maxAge, boolean secure) { - this(domain, name, value, path, - new Date(System.currentTimeMillis() + maxAge * 1000L), secure); + this(domain, name, value, path, null, secure); + if (maxAge < 0) { + throw new IllegalArgumentException("Max age name may not be negative"); + } + setExpiryDate(new Date(System.currentTimeMillis() + maxAge * 1000L)); } /**
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]