File primaryDir = new File(configuration.getURL().getPath() + '/' + STORAGE_DIR); boolean primaryReadOnly = configuration.isReadOnly();
if (configuration == null) { RegistryProperties.setProperty(IRegistryConstants.PROP_NO_REGISTRY_CACHE, "true"); RegistryProperties.setProperty(IRegistryConstants.PROP_NO_LAZY_CACHE_LOADING, "true"); strategy = new RegistryStrategyOSGI(null, null, masterRegistryKey); } else { File primaryDir = new File(configuration.getURL().getPath() + '/' + STORAGE_DIR); boolean primaryReadOnly = configuration.isReadOnly();
	public void startRegistry() throws CoreException {		// see if the customer suppressed the creation of default registry		String property = bundleContext.getProperty(IRegistryConstants.PROP_DEFAULT_REGISTRY);		if (property != null && property.equalsIgnoreCase("false")) //$NON-NLS-1$			return;		// check to see if we need to use null as a userToken		if ("true".equals(bundleContext.getProperty(IRegistryConstants.PROP_REGISTRY_NULL_USER_TOKEN))) //$NON-NLS-1$			userRegistryKey = null;		// Determine primary and alternative registry locations. Eclipse extension registry cache 		// can be found in one of the two locations:		// a) in the local configuration area (standard location passed in by the platform) -> priority		// b) in the shared configuration area (typically, shared install is used) 		File[] registryLocations;		boolean[] readOnlyLocations;		Location configuration = OSGIUtils.getDefault().getConfigurationLocation();		File primaryDir = new File(configuration.getURL().getPath() + '/' + STORAGE_DIR);		boolean primaryReadOnly = configuration.isReadOnly();		Location parentLocation = configuration.getParentLocation();		if (parentLocation != null) {			File secondaryDir = new File(parentLocation.getURL().getFile() + '/' + IRegistryConstants.RUNTIME_NAME);			registryLocations = new File[] {primaryDir, secondaryDir};			readOnlyLocations = new boolean[] {primaryReadOnly, true}; // secondary Eclipse location is always read only		} else {			registryLocations = new File[] {primaryDir};			readOnlyLocations = new boolean[] {primaryReadOnly};		}		EquinoxRegistryStrategy registryStrategy = new EquinoxRegistryStrategy(registryLocations, readOnlyLocations, masterRegistryKey);		defaultRegistry = RegistryFactory.createRegistry(registryStrategy, masterRegistryKey, userRegistryKey);		registryRegistration = Activator.getContext().registerService(IExtensionRegistry.class.getName(), defaultRegistry, new Hashtable());		defaultProvider = new RegistryProviderOSGI();		// Set the registry provider and specify this as a default registry:		RegistryProviderFactory.setDefault(defaultProvider);	}