### Eclipse Workspace Patch 1.0 #P org.eclipse.pde.core Index: src/org/eclipse/pde/internal/core/PDEAuxiliaryState.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEAuxiliaryState.java,v retrieving revision 1.5 diff -u -r1.5 PDEAuxiliaryState.java --- src/org/eclipse/pde/internal/core/PDEAuxiliaryState.java 8 Jun 2007 16:06:51 -0000 1.5 +++ src/org/eclipse/pde/internal/core/PDEAuxiliaryState.java 25 Oct 2007 21:30:08 -0000 @@ -227,6 +227,8 @@ for (int i = 0; i < models.length; i++) { IPluginBase plugin = models[i].getPluginBase(); BundleDescription desc = models[i].getBundleDescription(); + if (desc == null) + continue; Element element = doc.createElement(ELEMENT_BUNDLE); element.setAttribute(ATTR_BUNDLE_ID, Long.toString(desc.getBundleId())); element.setAttribute(ATTR_PROJECT, models[i].getUnderlyingResource().getProject().getName()); Index: src/org/eclipse/pde/internal/core/PDEState.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/PDEState.java,v retrieving revision 1.99 diff -u -r1.99 PDEState.java --- src/org/eclipse/pde/internal/core/PDEState.java 15 Oct 2007 22:34:54 -0000 1.99 +++ src/org/eclipse/pde/internal/core/PDEState.java 25 Oct 2007 21:30:08 -0000 @@ -340,7 +340,9 @@ File dir = new File(DIR, Long.toString(timestamp) + ".workspace"); //$NON-NLS-1$ State state = stateObjectFactory.createState(false); for (int i = 0; i < models.length; i++) { - state.addBundle(models[i].getBundleDescription()); + BundleDescription desc = models[i].getBundleDescription(); + if (desc != null) + state.addBundle(desc); } saveState(state, dir); PDEAuxiliaryState.writePluginInfo(models, dir); @@ -363,16 +365,21 @@ } private boolean shouldSaveState(IPluginModelBase[] models) { + int nonOSGiModels = 0; for (int i = 0; i < models.length; i++) { String id = models[i].getPluginBase().getId(); - if (id == null - || id.trim().length() == 0 + if (id == null) { + // not an OSGi bundle + ++nonOSGiModels; + continue; + } + if (id.trim().length() == 0 || !models[i].isLoaded() || !models[i].isInSync() || models[i].getBundleDescription() == null) return false; } - return models.length > 0; + return models.length - nonOSGiModels > 0; } private void clearStaleStates(String extension, long latest) { Index: src/org/eclipse/pde/internal/core/WorkspacePluginModelManager.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/WorkspacePluginModelManager.java,v retrieving revision 1.8 diff -u -r1.8 WorkspacePluginModelManager.java --- src/org/eclipse/pde/internal/core/WorkspacePluginModelManager.java 29 Aug 2007 19:03:59 -0000 1.8 +++ src/org/eclipse/pde/internal/core/WorkspacePluginModelManager.java 25 Oct 2007 21:30:08 -0000 @@ -434,6 +434,13 @@ IProject project = models[i].getUnderlyingResource().getProject(); fModels.put(project, models[i]); } + IProject[] projects = PDECore.getWorkspace().getRoot().getProjects(); + for (int i = 0; i < projects.length; i++) { + // if any projects contained Manifest files and were not included in the PDEState, + // we should create models for them now + if (!fModels.containsKey(projects[i]) && isInterestingProject(projects[i])) + createModel(projects[i], false); + } addListeners(); }