Revision 45425 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/featureset/DefaultFeatureSet.java
DefaultFeatureSet.java | ||
---|---|---|
68 | 68 |
protected static final int ORDERD_EDITED = 6; |
69 | 69 |
protected static final int ORDERED_EDITED_FILTER = 7; |
70 | 70 |
|
71 |
protected Throwable sourceStoreModifiedCause; |
|
71 | 72 |
protected boolean sourceStoreModified; |
72 | 73 |
protected boolean ownFeaturesModified; |
73 | 74 |
protected DefaultFeatureStore store; |
... | ... | |
95 | 96 |
this.size = -1; |
96 | 97 |
this.orderedData = null; |
97 | 98 |
this.store = store; |
99 |
DisposeUtils.bind(this.store); |
|
98 | 100 |
if (this.store.isEditing()) { |
99 | 101 |
this.transform = this.store.getFeatureTypeManager().getTransforms(); |
100 | 102 |
} else { |
... | ... | |
305 | 307 |
public void doDispose() { |
306 | 308 |
if( this.store!=null ) { |
307 | 309 |
this.store.deleteObserver(this); |
310 |
DisposeUtils.dispose(this.store); |
|
308 | 311 |
this.store = null; |
309 | 312 |
} |
310 | 313 |
if( this.provider!=null ) { |
... | ... | |
339 | 342 |
return; |
340 | 343 |
} |
341 | 344 |
sourceStoreModified = true; |
345 |
sourceStoreModifiedCause = new Throwable(); |
|
342 | 346 |
return; |
343 | 347 |
} |
344 | 348 |
if (type.equalsIgnoreCase(FeatureStoreNotification.AFTER_UPDATE_TYPE) |
345 | 349 |
|| type.equalsIgnoreCase(FeatureStoreNotification.AFTER_REDO) |
346 | 350 |
|| type.equalsIgnoreCase(FeatureStoreNotification.AFTER_UNDO) |
347 | 351 |
|| type.equalsIgnoreCase(FeatureStoreNotification.AFTER_REFRESH) |
348 |
|| type |
|
349 |
.equalsIgnoreCase(FeatureStoreNotification.COMPLEX_NOTIFICATION) |
|
350 |
|| type.equalsIgnoreCase(FeatureStoreNotification.AFTER_CLOSE) |
|
351 |
|| type.equalsIgnoreCase(FeatureStoreNotification.AFTER_DISPOSE) |
|
352 |
|| type.equalsIgnoreCase(FeatureStoreNotification.COMPLEX_NOTIFICATION) |
|
353 |
// || type.equalsIgnoreCase(FeatureStoreNotification.AFTER_CLOSE) |
|
354 |
// || type.equalsIgnoreCase(FeatureStoreNotification.AFTER_DISPOSE) |
|
352 | 355 |
|| type.equalsIgnoreCase(FeatureStoreNotification.TRANSFORM_CHANGE)) { |
353 | 356 |
sourceStoreModified = true; |
357 |
sourceStoreModifiedCause = new Throwable(); |
|
354 | 358 |
return; |
355 | 359 |
} |
356 | 360 |
if (type.equalsIgnoreCase(FeatureStoreNotification.RESOURCE_CHANGED)) { |
357 | 361 |
if(!this.ignoreChanges) { |
358 | 362 |
sourceStoreModified = true; |
363 |
sourceStoreModifiedCause = new Throwable(); |
|
359 | 364 |
return; |
360 | 365 |
} |
361 | 366 |
} |
362 | 367 |
if (type.equalsIgnoreCase(FeatureStoreNotification.AFTER_CANCELEDITING)) { |
363 | 368 |
if (ownFeaturesModified) { |
364 | 369 |
sourceStoreModified = true; |
370 |
sourceStoreModifiedCause = new Throwable(); |
|
365 | 371 |
return; |
366 | 372 |
} |
367 | 373 |
} |
... | ... | |
369 | 375 |
|
370 | 376 |
protected void checkSourceStoreModified() { |
371 | 377 |
if (sourceStoreModified) { |
372 |
throw new ConcurrentDataModificationException(store == null ? "" |
|
373 |
: store.getName()); |
|
378 |
ConcurrentDataModificationException ex = new ConcurrentDataModificationException( |
|
379 |
store == null ? "": store.getName() |
|
380 |
); |
|
381 |
ex.initCause(sourceStoreModifiedCause); |
|
382 |
throw ex; |
|
374 | 383 |
} |
375 | 384 |
} |
376 | 385 |
|
Also available in: Unified diff