Revision 47758

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
320 320
        }
321 321

  
322 322
        long positionForIndex = index - (currentPage2 * maxPageSize);
323

  
324
        if (positionForIndex >= getCurrentPageFeatures().length) {
323
        int size = getCurrentPageFeatures().length;
324
        if (positionForIndex >= size) {
325 325
            throw new FeatureIndexException(
326
                    new IndexOutOfBoundsException("positionForIndex too big: "
327
                            + positionForIndex));
326
                    new IndexOutOfBoundsException("Index: "+index+", Size: "+size)
327
            );
328 328
        } else {
329 329
            Feature feature = getCurrentPageFeatures()[(int) positionForIndex];
330 330
            return feature;
......
1011 1011
    public Feature get64(long position) {
1012 1012
        try {
1013 1013
            return getFeatureAt(position);
1014
        } catch (FeatureIndexException e) {
1015
            throw e.getIndexOutOfBoundsException();
1014 1016
        } catch (ConcurrentDataModificationException ex) {
1015 1017
            LOG.warn("ConcurrentDataModification error getting element " + position + " of the list. Retrying reloading data. "+(featSet==null?0:featSet.hashCode()));
1016 1018
            try {
......
1021 1023
            }
1022 1024
            try {
1023 1025
                return getFeatureAt(position);
1026
            } catch (FeatureIndexException e) {
1027
                throw e.getIndexOutOfBoundsException();
1024 1028
            } catch (Exception e) {
1025 1029
                LOG.warn("Error getting element " + position + " of the list after reloading data. "+(featSet==null?0:featSet.hashCode()), e);
1026 1030
                throw new RuntimeException(e);

Also available in: Unified diff