--- old/test/tools/lib/ToolBox.java 2015-06-23 14:27:30.000000000 +0200 +++ new/test/tools/lib/ToolBox.java 2015-06-23 14:27:30.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1594,15 +1594,20 @@ } /* - * A jar: URL is of the form jar:URL!/entry where URL is a URL for the .jar file itself. + * A jar: URL is of the form jar:URL!/ where URL is a URL for the .jar file itself. * In Symbol files (i.e. ct.sym) the underlying entry is prefixed META-INF/sym/. */ private final Pattern jarEntry = Pattern.compile(".*!/(?:META-INF/sym/[^/]+/)?(.*)"); /* - * A jrt: URL is of the form jrt:/module/package/file + * A jrt: URL is of the form jrt:/modules/// */ - private final Pattern jrtEntry = Pattern.compile("/([^/]+)/(.*)"); + private final Pattern jrtEntry = Pattern.compile("/modules/([^/]+)/(.*)"); + + /* + * A file: URL is of the form file:/path/to/modules/// + */ + private final Pattern fileEntry = Pattern.compile(".*/modules/([^/]+)/(.*)"); private String guessPath(FileObject fo) { URI u = fo.toUri(); @@ -1621,6 +1626,13 @@ } break; } + case "file": { + Matcher m = fileEntry.matcher(u.getSchemeSpecificPart()); + if (m.matches()) { + return m.group(2); + } + break; + } } throw new IllegalArgumentException(fo.getName() + "--" + fo.toUri()); }