Details
-
Bug
-
Resolution: Fixed
-
P2
-
8
-
b94
-
generic
-
generic
-
Verified
Description
This testcase passes with JDK8 b48 and fails JDK8 b49
import java.net.HttpCookie;
public class Test {
public static void main(String argv[]) {
System.out.println(new Test().run());
}
public String run() {
try {
new HttpCookie("$Name", "value");
return "Failed";
} catch (IllegalArgumentException e) {
return "OKAY";
}
}
}
Run example:
jdk1.8.0b48\bin\java.exe Test
OKAY
jdk1.8.0b49\bin\java.exe Test
Failed
Checking on '$' character was missed during fix CR7183292
See: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7bd32bfc0539
- if (name.length() == 0 || !isToken(name) || isReserved(name)) {
+ if (name.length() == 0 || !isToken(name)) {
Nevertheless in the JDK7, all is well:
http://hg.openjdk.java.net/jdk7u/jdk7u6-dev/jdk/rev/cbb4a165d660
- if (name.length() == 0 || !isToken(name) || isReserved(name)) {
+ if (name.length() == 0 || !isToken(name) || name.charAt(0) == '$') {
import java.net.HttpCookie;
public class Test {
public static void main(String argv[]) {
System.out.println(new Test().run());
}
public String run() {
try {
new HttpCookie("$Name", "value");
return "Failed";
} catch (IllegalArgumentException e) {
return "OKAY";
}
}
}
Run example:
jdk1.8.0b48\bin\java.exe Test
OKAY
jdk1.8.0b49\bin\java.exe Test
Failed
Checking on '$' character was missed during fix CR7183292
See: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/7bd32bfc0539
- if (name.length() == 0 || !isToken(name) || isReserved(name)) {
+ if (name.length() == 0 || !isToken(name)) {
Nevertheless in the JDK7, all is well:
http://hg.openjdk.java.net/jdk7u/jdk7u6-dev/jdk/rev/cbb4a165d660
- if (name.length() == 0 || !isToken(name) || isReserved(name)) {
+ if (name.length() == 0 || !isToken(name) || name.charAt(0) == '$') {
Attachments
Issue Links
- relates to
-
JDK-7185224 Update HttpCookie constructor doc for @exception IllegalArgumentException
- Resolved