Initialize STGroupFile with url, not file path

- absolute file paths not reliable way to find resources on classpath
- requires changes to ST4 in this PR:
https://github.com/antlr/stringtemplate4/pull/199
This commit is contained in:
Joseph Smith 2018-04-24 17:43:00 -05:00
parent 7e93bf3e09
commit 7e89f26e9b
1 changed files with 2 additions and 2 deletions

View File

@ -509,7 +509,7 @@ public abstract class Target {
URL url = Thread.currentThread().getContextClassLoader().getResource(groupFileName);
STGroup result = null;
try {
result = new STGroupFile(url.getPath());
result = new STGroupFile(url);
}
catch (IllegalArgumentException iae) {
result = null;
@ -524,7 +524,7 @@ public abstract class Target {
STGroup result = null;
try {
result = new STGroupFile(url.getPath());
result = new STGroupFile(url);
}
catch (IllegalArgumentException iae) {
gen.tool.errMgr.toolError(ErrorType.MISSING_CODE_GEN_TEMPLATES,