Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.6
-
None
-
JDK 1.7u51
Description
When adding Groovy Files from the file system to the GroovyClassLoader's classpath grabbed from a default java properties file ("/" instead of "\"))
Then the addClasspath() method uses a simple URL instead of the File URL
This is due to a simple mistake in this mentioned method:
public void addClasspath(final String path) { .... if (!URI_PATTERN.matcher(path).matches()) { newURI = new File(path).toURI(); } else { newURI = new URI(path); } } private static final Pattern URI_PATTERN = Pattern.compile("\\p{Alpha}[-+.\\p{Alnum}]*:[^\\\\]*");
The URI_PATTERN which should match "URIs but not Windows filenames" doesn't work as expected.
It matches i.e. C:/xxx/file.ext
This is related to using forward instead of backslashes - which souldn't matter.
This was i.e. NOT the case for Groovy 2.1.3
Attachments
Issue Links
- relates to
-
GROOVY-7097 ScriptBase class can't be resolved if not in current directory even if CompilerConf classpath is set
- Closed
-
GROOVY-7022 invoking scripts using full path broken in cygwin
- Closed