8252767: URLConnection.setRequestProperty throws IllegalAccessError

Reviewed-by: chegar, michaelm, alanb
This commit is contained in:
Jaikiran Pai 2020-09-08 09:10:15 +00:00 committed by Daniel Fuchs
parent 2cceeedfe1
commit 5dd1eaded7
2 changed files with 132 additions and 34 deletions

View file

@ -71,7 +71,7 @@ public abstract class URLConnection extends java.net.URLConnection {
public void setRequestProperty(String key, String value) {
if(connected)
throw new IllegalAccessError("Already connected");
throw new IllegalStateException("Already connected");
if (key == null)
throw new NullPointerException ("key cannot be null");
properties.set(key, value);