-
Bug
-
Resolution: Fixed
-
P3
-
8, 25
-
b11
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8369661 | 25.0.2 | Kieran Farrell | P3 | Resolved | Fixed | master |
JDK-8369662 | 21.0.10-oracle | Kieran Farrell | P3 | Resolved | Fixed | master |
JDK-8369664 | 17.0.18-oracle | Kieran Farrell | P3 | Resolved | Fixed | master |
JDK-8370106 | 11.0.30-oracle | Kieran Farrell | P3 | Resolved | Fixed | master |
CookieStore.getURIs should return "an immutable list of URIs; return empty list if no cookie in this cookie store is associated with an URI" based on its JavaDoc, but actually it just returns an ArrayList, and can do some changes on this list.
---------- BEGIN SOURCE ----------
import java.net.*;
import java.util.*;
public class ImmutableTest {
public static void main(String[] args) throws Exception {
CookieManager cm = new CookieManager();
CookieStore cs = cm.getCookieStore();
cs.add(new URI("https://immutable.example.com"), new HttpCookie("c", "v"));
List<URI> uris = cs.getURIs();
System.out.println(uris.getClass());
System.out.println(uris);
try {
uris.add(new URI("https://should.fail.example.com"));
System.out.println(uris);
throw new RuntimeException("immutable CookieStore URIs list should not allow modification");
} catch (UnsupportedOperationException expected) {
// Test passed - expected exception
}
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8369661 CookieStore.getURIs() and get(URI) should return an immutable List
-
- Resolved
-
-
JDK-8369662 CookieStore.getURIs() and get(URI) should return an immutable List
-
- Resolved
-
-
JDK-8369664 CookieStore.getURIs() and get(URI) should return an immutable List
-
- Resolved
-
-
JDK-8370106 CookieStore.getURIs() and get(URI) should return an immutable List
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk25u/07af85cb
-
Commit(master) openjdk/jdk/022e29a7
-
Review(master) openjdk/jdk25u/319
-
Review(master) openjdk/jdk/26698