Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] AbstractFeatureStore vs. UdigFeatureStore

After switching to SDK 1.1RC10 I got an odd nullpointer exception at removing features of a feature store.
 
I use a temporary / memory based layer which is wrapped by a class called LayerContainer. This class has some convenience methods for changing the (SLD) style and for adding / removing objects like this one:
 
private void removeAllContent(){
  FeatureStore fs = layer.getGeoRessource().resolve(FeatureStore.class,null);
  fs.removeFeaures(Filter.NONE);
}
 
Using SDK1.1RC8 the object "fs" is an AbstractFeatureStore. Using SDK1.1RC10 it is an UDIGFeatureStore which calls the method "setTransactionInternal" in every method which changes the set of features. In setTransactionInternal this line fails in my application:
 
Transaction transaction = ((EditManager)) layer.getMap().getEditManager()).getTransaction();
 
layer.getMap() returns null
getMap() invokes getMapInternal() invokes getContextModel() which returns the eContainer (type: InternalObject) which is null
 
I can only guess what happens: The the layer is manipulated (adding / removing features) before the map is opened in a MapEditor the first time. This is done since the user can "add objects to map" in a perspective which has no visible map / no MapEditor. The class LayerContainer is notified via eventmanagement and adds / removes features. Under 1.1RC8 this doesn't matter since another FeatureStore is used.
(The map object is created before the layer is instanced.)
 
 
what can I do?
 
tony roth

Back to the top