View | Details | Raw Unified | Return to bug 206765 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/core/PDEAuxiliaryState.java (+2 lines)
Lines 227-232 Link Here
227
			for (int i = 0; i < models.length; i++) {
227
			for (int i = 0; i < models.length; i++) {
228
				IPluginBase plugin = models[i].getPluginBase();
228
				IPluginBase plugin = models[i].getPluginBase();
229
				BundleDescription desc = models[i].getBundleDescription();
229
				BundleDescription desc = models[i].getBundleDescription();
230
				if (desc == null)
231
					continue;
230
				Element element = doc.createElement(ELEMENT_BUNDLE); 
232
				Element element = doc.createElement(ELEMENT_BUNDLE); 
231
				element.setAttribute(ATTR_BUNDLE_ID, Long.toString(desc.getBundleId())); 
233
				element.setAttribute(ATTR_BUNDLE_ID, Long.toString(desc.getBundleId())); 
232
				element.setAttribute(ATTR_PROJECT, models[i].getUnderlyingResource().getProject().getName()); 
234
				element.setAttribute(ATTR_PROJECT, models[i].getUnderlyingResource().getProject().getName()); 
(-)src/org/eclipse/pde/internal/core/PDEState.java (-4 / +11 lines)
Lines 306-312 Link Here
306
			File dir = new File(DIR, Long.toString(timestamp) + ".workspace"); //$NON-NLS-1$
306
			File dir = new File(DIR, Long.toString(timestamp) + ".workspace"); //$NON-NLS-1$
307
			State state = stateObjectFactory.createState(false);
307
			State state = stateObjectFactory.createState(false);
308
			for (int i = 0; i < models.length; i++) {
308
			for (int i = 0; i < models.length; i++) {
309
				state.addBundle(models[i].getBundleDescription());
309
				BundleDescription desc = models[i].getBundleDescription();
310
				if (desc != null)
311
					state.addBundle(desc);
310
			}
312
			}
311
			saveState(state, dir);
313
			saveState(state, dir);
312
			PDEAuxiliaryState.writePluginInfo(models, dir);
314
			PDEAuxiliaryState.writePluginInfo(models, dir);
Lines 330-345 Link Here
330
	}
332
	}
331
	
333
	
332
	private boolean shouldSaveState(IPluginModelBase[] models) {
334
	private boolean shouldSaveState(IPluginModelBase[] models) {
335
		int nonOSGiModels = 0;
333
		for (int i = 0; i < models.length; i++) {
336
		for (int i = 0; i < models.length; i++) {
334
			String id = models[i].getPluginBase().getId();
337
			String id = models[i].getPluginBase().getId();
335
			if (id == null
338
			if (id == null) {
336
					|| id.trim().length() == 0
339
				// not an OSGi bundle
340
				++nonOSGiModels;
341
				continue;
342
			}
343
			if (id.trim().length() == 0
337
					|| !models[i].isLoaded()
344
					|| !models[i].isLoaded()
338
					|| !models[i].isInSync() 
345
					|| !models[i].isInSync() 
339
					|| models[i].getBundleDescription() == null)
346
					|| models[i].getBundleDescription() == null)
340
				return false;
347
				return false;
341
		}
348
		}
342
		return models.length > 0;
349
		return models.length - nonOSGiModels > 0;
343
	}
350
	}
344
	
351
	
345
	private void clearStaleStates(String extension, long latest) {
352
	private void clearStaleStates(String extension, long latest) {
(-)src/org/eclipse/pde/internal/core/WorkspacePluginModelManager.java (+7 lines)
Lines 413-418 Link Here
413
			IProject project = models[i].getUnderlyingResource().getProject();
413
			IProject project = models[i].getUnderlyingResource().getProject();
414
			fModels.put(project, models[i]);
414
			fModels.put(project, models[i]);
415
		}
415
		}
416
		IProject[] projects = PDECore.getWorkspace().getRoot().getProjects();	
417
		for (int i = 0; i < projects.length; i++) {
418
			// if any projects contained Manifest files and were not included in the PDEState,
419
			// we should create models for them now
420
			if (!fModels.containsKey(projects[i]) && isInterestingProject(projects[i]))
421
				createModel(projects[i], false);			
422
		}
416
		addListeners();
423
		addListeners();
417
	}
424
	}
418
	
425
	

Return to bug 206765