Revision 38865 branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dbf/DBFStoreProvider.java

View differences:

DBFStoreProvider.java
639 639
	 */
640 640
	protected void loadFeatureProviderByIndex(FeatureProvider featureProvider)
641 641
			throws DataException {
642
	    
642 643
		long index = ((Long) featureProvider.getOID()).longValue();
643
		if (index >= this.dbfFile.getRecordCount()) {
644
			// FIXME
645
			throw new ArrayIndexOutOfBoundsException("" + index);
646
		}
644
        int rec_count = this.dbfFile.getRecordCount();
645
        
646
        if (index >= rec_count) {
647

  
648
            ReadException rex = new ReadException(NAME,
649
                new ArrayIndexOutOfBoundsException(
650
                "Index of requested feature (" +
651
                index + ") is >= record count (" + rec_count + ")"));
652
            
653
            LOG.info("Error while loading feature. ", rex);
654
            throw rex;
655
        }		
656
		
647 657
		Iterator iterator = featureProvider.getType().iterator();
648 658
		while (iterator.hasNext()) {
649 659
			FeatureAttributeDescriptor descriptor =

Also available in: Unified diff