mirror of
https://github.com/openjdk/jdk18u.git
synced 2025-12-10 16:28:08 -06:00
8282300: Throws NamingException instead of InvalidNameException after JDK-8278972
Backport-of: e6afb6ff81c9004aadaa6f694e643de9703dd32d
This commit is contained in:
parent
7a9ab7c5c3
commit
517b53e7cc
@ -147,6 +147,12 @@ public class rmiURLContext extends GenericURLContext {
|
||||
throw newNamingException(iae);
|
||||
}
|
||||
}
|
||||
int fmark = url.indexOf('#', i);
|
||||
if (fmark > -1) {
|
||||
if (!acceptsFragment()) {
|
||||
throw newNamingException(new IllegalArgumentException("URI fragments not supported: " + url));
|
||||
}
|
||||
}
|
||||
|
||||
if ("".equals(host)) {
|
||||
host = null;
|
||||
@ -280,12 +286,12 @@ public class rmiURLContext extends GenericURLContext {
|
||||
}
|
||||
|
||||
NamingException newNamingException(Throwable cause) {
|
||||
NamingException ne = new NamingException(cause.getMessage());
|
||||
NamingException ne = new InvalidNameException(cause.getMessage());
|
||||
ne.initCause(cause);
|
||||
return ne;
|
||||
}
|
||||
|
||||
boolean acceptsFragment() {
|
||||
protected boolean acceptsFragment() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user