Re: RFR: 8292182: [TESTLIB] Enhance JAXPPolicyManager to setup required permissions for jtreg version 7 jar [v2]
On Sat, 13 Aug 2022 03:41:04 GMT, Jaikiran Pai wrote: >> Christian Stein has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove unused import statement > > test/jaxp/javax/xml/jaxp/libs/jaxp/library/JAXPPolicyManager.java line 217: > >> 215: URL loc = (cs == null) ? null : cs.getLocation(); >> 216: String path = (loc == null) ? null : loc.getPath(); >> 217: String name = (path == null) ? null : >> path.substring(path.lastIndexOf('/') + 1); > > Is there a chance that this path could end with `/` and thus lead to a > `IndexOutOfBoundsException` on this call to `substring`? Yes. Usually the URL of the domain's code source points to a JAR file - but it is possible that a directory is the code source. Then the URL could end with a `/` character. Will refactor the fix to use `Path::getFileName`. - PR: https://git.openjdk.org/jdk/pull/9857
Re: RFR: 8292182: [TESTLIB] Enhance JAXPPolicyManager to setup required permissions for jtreg version 7 jar [v2]
On Fri, 12 Aug 2022 20:41:24 GMT, Christian Stein wrote: >> Enhance `JAXPPolicyManager` to setup required permissions for `jtreg` 7 by >> accept version information in JAR file names. >> >> Find details in https://bugs.openjdk.org/browse/JDK-8292182 > > Christian Stein has updated the pull request incrementally with one > additional commit since the last revision: > > Remove unused import statement test/jaxp/javax/xml/jaxp/libs/jaxp/library/JAXPPolicyManager.java line 217: > 215: URL loc = (cs == null) ? null : cs.getLocation(); > 216: String path = (loc == null) ? null : loc.getPath(); > 217: String name = (path == null) ? null : > path.substring(path.lastIndexOf('/') + 1); Is there a chance that this path could end with `/` and thus lead to a `IndexOutOfBoundsException` on this call to `substring`? - PR: https://git.openjdk.org/jdk/pull/9857
Re: RFR: 8292182: [TESTLIB] Enhance JAXPPolicyManager to setup required permissions for jtreg version 7 jar [v2]
On Fri, 12 Aug 2022 20:18:50 GMT, Naoto Sato wrote: >> Christian Stein has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove unused import statement > > test/jaxp/javax/xml/jaxp/libs/jaxp/library/JAXPPolicyManager.java line 27: > >> 25: >> 26: import java.net.URL; >> 27: import java.nio.file.Path; > > Nit: leftover import? Yes. Removed the line. - PR: https://git.openjdk.org/jdk/pull/9857