Revision 43377 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/DefaultFeatureStore.java

View differences:

DefaultFeatureStore.java
387 387
        }
388 388
        this.notifyChange(DataStoreNotification.BEFORE_DISPOSE);
389 389
        this.disposeIndexes();
390
        this.provider.dispose();
390
        if( this.provider!=null ) {
391
            this.provider.dispose();
392
        }
391 393
        if (this.selection != null) {
392 394
            this.selection.dispose();
393 395
            this.selection = null;
......
1147 1149
    private void disposeIndexes() {
1148 1150
        FeatureIndexes theIndexes = getIndexes();
1149 1151
        LOG.debug("Disposing indexes: {}", theIndexes);
1152
        if( theIndexes==null ) {
1153
            return;
1154
        }
1150 1155
        for (Iterator iterator = theIndexes.iterator(); iterator.hasNext();) {
1151 1156
            FeatureIndex index = (FeatureIndex) iterator.next();
1152 1157
            if (index instanceof FeatureIndexProviderServices) {
......
1410 1415
                throw new NeedEditingModeException(this.getName());
1411 1416

  
1412 1417
            case MODE_APPEND:
1413
                ((FeatureSelection) this.getSelection()).deselectAll();
1418
                if( selection!=null ) {
1419
                    selection = null;
1420
                }
1414 1421
                notifyChange(FeatureStoreNotification.BEFORE_FINISHEDITING);
1415 1422
                provider.endAppend();
1416 1423
                exitEditingMode();
......
1422 1429
                if (hasStrongChanges && !this.allowWrite()) {
1423 1430
                    throw new WriteNotAllowedException(getName());
1424 1431
                }
1425

  
1426
                if(featureManager.isSelectionCompromised()) {
1427
                    ((FeatureSelection) this.getSelection()).deselectAll();
1428
                };
1429

  
1432
                if(featureManager.isSelectionCompromised() && selection!=null ) {
1433
                    selection = null;
1434
                }
1430 1435
                notifyChange(FeatureStoreNotification.BEFORE_FINISHEDITING);
1431 1436
                if (hasStrongChanges) {
1432 1437
                    validateFeatures(Feature.FINISH_EDITING);
......
2101 2106

  
2102 2107
    @Override
2103 2108
    public EditableFeatureType createFeatureType() {
2104
        DefaultEditableFeatureType ftype = new DefaultEditableFeatureType();
2109
        EditableFeatureType ftype = this.dataManager.createFeatureType();
2105 2110
        return ftype;
2106 2111
    }
2107 2112

  

Also available in: Unified diff