currData.setTemplate(new Template(oldTemplate.getName(), oldTemplate.getDescription(), oldTemplate.getContextTypeId(), newComment));
currData.setTemplate(new Template(oldTemplate.getName(), oldTemplate.getDescription(), oldTemplate.getContextTypeId(), newComment, oldTemplate.isAutoInsertable()));
	public void testProjectCodeTemplates1() throws Exception {		fJProject1= JavaProjectHelper.createJavaProject("TestProject1", "bin");		try {			ProjectTemplateStore projectStore= new ProjectTemplateStore(fJProject1.getProject());			projectStore.load();			ProjectTemplateStore instanceStore= new ProjectTemplateStore(null);			instanceStore.load();									TemplatePersistenceData[] allTemplateDatas= projectStore.getTemplateData();			assertEquals(ALL_CODE_TEMPLATES.length, allTemplateDatas.length);			for (int i= 0; i < ALL_CODE_TEMPLATES.length; i++) {				// get it from the array				TemplatePersistenceData fromArray=  find(ALL_CODE_TEMPLATES[i], allTemplateDatas);				assertNotNull(fromArray);				// get it from the store by id				Template fromStore=  projectStore.findTemplateById(ALL_CODE_TEMPLATES[i]);				assertNotNull(fromStore);				assertEquals(fromArray.getTemplate().getPattern(), fromStore.getPattern());								// equal to instance				Template fromInstance=  instanceStore.findTemplateById(ALL_CODE_TEMPLATES[i]);				assertNotNull(fromInstance);				assertEquals(fromInstance.getPattern(), fromStore.getPattern());			}									String newComment= "//Hello2";			String templateId= CodeTemplateContextType.SETTERCOMMENT_ID;						// make project specific			projectStore.setProjectSpecific(templateId, true);			assertTrue(projectStore.isProjectSpecific(templateId));						// modify template			TemplatePersistenceData currData= find(templateId, allTemplateDatas);			Template oldTemplate= currData.getTemplate();			currData.setTemplate(new Template(oldTemplate.getName(), oldTemplate.getDescription(), oldTemplate.getContextTypeId(), newComment));			Template currTempl= projectStore.findTemplateById(templateId);			assertTrue(currTempl.getPattern().equals(newComment));			Template instanceElem= instanceStore.findTemplateById(templateId);			assertFalse(instanceElem.getPattern().equals(currTempl.getPattern()));						// remove project specific			projectStore.setProjectSpecific(templateId, false);			assertFalse(projectStore.isProjectSpecific(templateId));						currTempl= projectStore.findTemplateById(templateId);			assertFalse(currTempl.getPattern().equals(newComment));			assertTrue(instanceElem.getPattern().equals(currTempl.getPattern()));						// make project specific again and restore defaults			projectStore.setProjectSpecific(templateId, true);			assertTrue(projectStore.isProjectSpecific(templateId));						projectStore.restoreDefaults(); // restore						currTempl= projectStore.findTemplateById(templateId);			assertFalse(currTempl.getPattern().equals(newComment));			assertTrue(currTempl.getPattern().equals(instanceElem.getPattern()));		} finally {			JavaProjectHelper.delete(fJProject1);		}	}