Use STGroupFile filename constructor

- URL constructor unnecessary
This commit is contained in:
Joseph Smith 2018-11-13 14:59:12 -06:00
parent 7fcadaa9f7
commit 6f057dbc59
1 changed files with 2 additions and 5 deletions

View File

@ -506,10 +506,9 @@ public abstract class Target {
public boolean templatesExist() {
String groupFileName = CodeGenerator.TEMPLATE_ROOT + "/" + getLanguage() + "/" + getLanguage() + STGroup.GROUP_FILE_EXTENSION;
URL url = Thread.currentThread().getContextClassLoader().getResource(groupFileName);
STGroup result = null;
try {
result = new STGroupFile(url);
result = new STGroupFile(groupFileName);
}
catch (IllegalArgumentException iae) {
result = null;
@ -520,11 +519,9 @@ public abstract class Target {
protected STGroup loadTemplates() {
String groupFileName = CodeGenerator.TEMPLATE_ROOT + "/" + getLanguage() + "/" + getLanguage() + STGroup.GROUP_FILE_EXTENSION;
URL url = Thread.currentThread().getContextClassLoader().getResource(groupFileName);
STGroup result = null;
try {
result = new STGroupFile(url);
result = new STGroupFile(groupFileName);
}
catch (IllegalArgumentException iae) {
gen.tool.errMgr.toolError(ErrorType.MISSING_CODE_GEN_TEMPLATES,