Bug 31075 Code Templates are not preserved
the new code templates are a great feature. The problem is when you close eclipse and start it up again they seem to be reset to the defaults.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeTemplateBlock.java
TemplateSet templateSet= new TemplateSet(fTemplates.getTemplateTag());
		for (int i= 0; i < selected.size(); i++) {
			Object curr= selected.get(i);
			if (curr instanceof Template) {
				addToTemplateSet(templateSet, (Template) curr);
			} else {
				Template[] templates= getTemplateOfCategory(curr == COMMENT_NODE);
				for (int k= 0; k < templates.length; k++) {
					addToTemplateSet(templateSet, templates[k]);
				}
			}
		}
		export(templateSet);
	}
	
	private void addToTemplateSet(TemplateSet set, Template template) {
		if (set.getFirstTemplate(template.getName()) == null) {
			set.add(template);
		}
	}
	
	private void export(TemplateSet templateSet) {
		FileDialog dialog= new FileDialog(getShell(), SWT.SAVE);
		dialog.setText(PreferencesMessages.getFormattedString("CodeTemplateBlock.export.title", String.valueOf(templateSet.getTemplates().length))); 
		dialog.setFilterExtensions(new String[] {PreferencesMessages.getString("CodeTemplateBlock.export.extension")}); 
		dialog.setFileName(PreferencesMessages.getString("CodeTemplateBlock.export.filename")); 
		String path= dialog.open();
		
		if (path == null)
			return;