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) { |