Revision 41268

View differences:

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/paging/impl/FeaturePagingHelperImpl.java
211 211

  
212 212
        long positionForIndex = index - (getCurrentPage() * getMaxPageSize());
213 213

  
214
        if (positionForIndex >= features.length) {
214
        if (positionForIndex >= getCurrentPageFeatures().length) {
215 215
            throw new FeatureIndexException(
216 216
                new IndexOutOfBoundsException("positionForIndex too big: "
217 217
                    + positionForIndex));
218 218
        } else {
219
            Feature feature = features[(int) positionForIndex];
219
            Feature feature = getCurrentPageFeatures()[(int) positionForIndex];
220 220
            return feature;
221 221
        }
222 222
        
223 223
    }
224 224

  
225 225
    public Feature[] getCurrentPageFeatures() {
226
        if( this.features==null ) {
227
            try {
228
                this.loadCurrentPageData();
229
            } catch (BaseException ex) {
230
                // Do nothing
231
            }
232
            if( this.features == null ) {
233
                String msg = "Can't retrieve the features from current page.";
234
                LOG.warn(msg);
235
                throw new RuntimeException(msg);
236
            }
237
        }
226 238
        return features;
227 239
    }
228 240

  

Also available in: Unified diff