1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

minor refactoring

This commit is contained in:
Andrew Gvozdev 2011-08-07 22:49:52 -04:00
parent fef68e3d8a
commit 455dfb6541
2 changed files with 5 additions and 4 deletions

View file

@ -37,6 +37,7 @@ import org.w3c.dom.Element;
* Test cases testing LanguageSettingsProvider functionality
*/
public class LanguageSettingsPersistenceProjectTests extends TestCase {
private static final String LANGUAGE_SETTINGS_PROJECT_XML = ".settings/language.settings.xml";
// Should match id of extension point defined in plugin.xml
private static final String EXTENSION_PROVIDER_ID = "org.eclipse.cdt.core.tests.language.settings.base.provider.subclass";
private static final String EXTENSION_PROVIDER_NAME = "Test Plugin Base Provider Subclass";
@ -744,7 +745,7 @@ public class LanguageSettingsPersistenceProjectTests extends TestCase {
// write to project description
coreModel.setProjectDescription(project, writableProjDescription);
IFile xmlStorageFile = project.getFile(".settings/language.settings.xml");
IFile xmlStorageFile = project.getFile(LANGUAGE_SETTINGS_PROJECT_XML);
assertTrue(xmlStorageFile.exists());
xmlStorageFileLocation = xmlStorageFile.getLocation().toOSString();
}

View file

@ -157,14 +157,14 @@ public class LanguageSettingsProvidersSerializer {
* @param store - name of the store
* @return location of the store in the plug-in state area
*/
private static URI getStoreLocation(String store) {
private static URI getStoreLocationInWorkspaceArea(String store) {
IPath location = CCorePlugin.getDefault().getStateLocation().append(store);
URI uri = URIUtil.toURI(location);
return uri;
}
public static void serializeLanguageSettingsWorkspace() throws CoreException {
URI uriLocation = getStoreLocation(STORAGE_WORKSPACE_LANGUAGE_SETTINGS);
URI uriLocation = getStoreLocationInWorkspaceArea(STORAGE_WORKSPACE_LANGUAGE_SETTINGS);
List<LanguageSettingsSerializable> serializableExtensionProviders = new ArrayList<LanguageSettingsSerializable>();
for (ILanguageSettingsProvider provider : rawGlobalWorkspaceProviders.values()) {
if (provider instanceof LanguageSettingsSerializable) {
@ -206,7 +206,7 @@ public class LanguageSettingsProvidersSerializer {
public static void loadLanguageSettingsWorkspace() throws CoreException {
List <ILanguageSettingsProvider> providers = null;
URI uriLocation = getStoreLocation(STORAGE_WORKSPACE_LANGUAGE_SETTINGS);
URI uriLocation = getStoreLocationInWorkspaceArea(STORAGE_WORKSPACE_LANGUAGE_SETTINGS);
Document doc = null;
try {