Removed the unnecessary last semicolon

This commit is contained in:
Trustin Lee 2009-03-13 15:48:23 +00:00
parent efd5af9313
commit 3e6f638449
2 changed files with 8 additions and 4 deletions

View File

@ -121,6 +121,8 @@ public class CookieEncoder {
}
}
}
sb.setLength(sb.length() - 1);
return sb.toString();
}
@ -157,6 +159,8 @@ public class CookieEncoder {
}
}
}
sb.setLength(sb.length() - 1);
return sb.toString();
}

View File

@ -37,7 +37,7 @@ import org.junit.Test;
public class CookieEncoderTest {
@Test
public void testEncodingSingleCookieV0() {
String result = "myCookie=myValue;expires=XXX;path=/apathsomewhere;domain=.adomainsomewhere;secure;";
String result = "myCookie=myValue;expires=XXX;path=/apathsomewhere;domain=.adomainsomewhere;secure";
Cookie cookie = new DefaultCookie("myCookie", "myValue");
CookieEncoder encoder = new CookieEncoder(true);
encoder.addCookie(cookie);
@ -55,7 +55,7 @@ public class CookieEncoderTest {
}
@Test
public void testEncodingSingleCookieV1() {
String result = "myCookie=myValue;max-age=50;path=/apathsomewhere;domain=.adomainsomewhere;secure;comment=this is a comment;version=1;";
String result = "myCookie=myValue;max-age=50;path=/apathsomewhere;domain=.adomainsomewhere;secure;comment=this is a comment;version=1";
Cookie cookie = new DefaultCookie("myCookie", "myValue");
CookieEncoder encoder = new CookieEncoder(true);
encoder.addCookie(cookie);
@ -70,7 +70,7 @@ public class CookieEncoderTest {
}
@Test
public void testEncodingSingleCookieV2() {
String result = "myCookie=myValue;max-age=50;path=/apathsomewhere;domain=.adomainsomewhere;secure;comment=this is a comment;version=1;commentURL=\"http://aurl.com\";port=\"80,8080\";discard;";
String result = "myCookie=myValue;max-age=50;path=/apathsomewhere;domain=.adomainsomewhere;secure;comment=this is a comment;version=1;commentURL=\"http://aurl.com\";port=\"80,8080\";discard";
Cookie cookie = new DefaultCookie("myCookie", "myValue");
CookieEncoder encoder = new CookieEncoder(true);
encoder.addCookie(cookie);
@ -91,7 +91,7 @@ public class CookieEncoderTest {
public void testEncodingMultipleCookies() {
String c1 = "myCookie=myValue;max-age=50;path=/apathsomewhere;domain=.adomainsomewhere;secure;comment=this is a comment;version=1;commentURL=\"http://aurl.com\";port=\"80,8080\";discard;";
String c2 = "myCookie2=myValue2;path=/anotherpathsomewhere;domain=.anotherdomainsomewhere;comment=this is another comment;version=1;commentURL=\"http://anotherurl.com\";";
String c3 = "myCookie3=myValue3;version=1;";
String c3 = "myCookie3=myValue3;version=1";
CookieEncoder encoder = new CookieEncoder(true);
Cookie cookie = new DefaultCookie("myCookie", "myValue");
cookie.setVersion(1);