File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/jdk.naming.rmi/share/classes/com/sun/jndi/url/rmi Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,12 @@ private void parseStrict() throws NamingException {
147147 throw newNamingException (iae );
148148 }
149149 }
150+ int fmark = url .indexOf ('#' , i );
151+ if (fmark > -1 ) {
152+ if (!acceptsFragment ()) {
153+ throw newNamingException (new IllegalArgumentException ("URI fragments not supported: " + url ));
154+ }
155+ }
150156
151157 if ("" .equals (host )) {
152158 host = null ;
@@ -280,12 +286,12 @@ private void parseLegacy() {
280286 }
281287
282288 NamingException newNamingException (Throwable cause ) {
283- NamingException ne = new NamingException (cause .getMessage ());
289+ NamingException ne = new InvalidNameException (cause .getMessage ());
284290 ne .initCause (cause );
285291 return ne ;
286292 }
287293
288- boolean acceptsFragment () {
294+ protected boolean acceptsFragment () {
289295 return true ;
290296 }
291297 }
You can’t perform that action at this time.
0 commit comments