Sometimes, when a new template is added in Template Manager, it does not appear in the list, although it's actually added.
This is caused by different threading.
createTemplateFromFile() creates the template via sourceDO.copy(folder) (which fires changes and attempts to add the newly created node) and then sets template.setTemplate(true);
Depending on whether template.setTemplate(true) happens to be called sooner than TemplateFilter.acceptTemplate() checks it, the newly added template file shows up, or not.
Fixed by changeset: 219069:a1eb663cef3b
Integrated into 'main-golden', will be available in build *201204181547* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Log: #211235: Assure, that the templates list is refreshed when file template attribute changes.