Community
Participate
Working Groups
The following code change is recommended in TemplateObjectEmiter.getObject(): before: ... Object o = fObjectEmitter.generateObjectFromExisting(cl,pm) ; if (o == null) { // Now compile the JET template and get the Java source fObjectEmitter.setSrc(getObjectSource(pm).toCharArray()) ; o = fObjectEmitter.generateObject(classPath,cl,pm) ; } after: Object o = fObjectEmitter.generateObjectFromExisting(cl,pm) ; if (o == null) { // Now compile the JET template and get the Java source fObjectEmitter.setSrc(getObjectSource(pm).toCharArray()) ; try { o = fObjectEmitter.generateObject(classPath,cl,pm) ; } catch (TemplatesException ex) { // reset src to null to allow runtime changes on template // and retrial after exception, without having to restart the app fObjectEmitter.setSrc(null); throw ex; } } If the creation of the code of a template-based custom widget fails for reasons of a buggy template, then retrial of compilation (after fixing the template) fails due to a TemplatesException: "Can not overide existing source" (originating at org.eclipse.ve.internal.java.vce.templates.JavaObjectEmiter). Setting of the template code on the emitter is disallowed the second time. But since the emitter didn't succeed in compiling the template, this should not be the case.