IndexOutOfBoundsException when using DEM

Description

When using a DEM it happened that an IndexOutOfBoundsException occurred.
It seems that the access to the elevationTileCache in BaseElevationModel is not threadsafe.

The cache seems not to be very useful. it is only populated and cleared but not used.
Maybe the call to ElevationTile.clearCache() is useful, but this is called in the dispose() of ElevationTile anyway.

java.lang.IndexOutOfBoundsException: Index: 61, Size: 60
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.remove(ArrayList.java:492)
at org.esa.snap.core.dataop.dem.BaseElevationModel.updateCache(BaseElevationModel.java:131)
at org.esa.snap.dataio.getasse30.GETASSE30File.createTile(GETASSE30File.java:43)
at org.esa.snap.core.dataop.dem.ElevationFile.getLocalFile(ElevationFile.java:142)
at org.esa.snap.core.dataop.dem.ElevationFile.getFile(ElevationFile.java:103)
at org.esa.snap.core.dataop.dem.ElevationFile.getTile(ElevationFile.java:83)
at org.esa.snap.core.dataop.dem.BaseElevationModel.getSamples(BaseElevationModel.java:159)
at org.esa.snap.core.dataop.resamp.BilinearInterpolationResampling.resample(BilinearInterpolationResampling.java:82)
at org.esa.snap.core.dataop.dem.BaseElevationModel.getElevation(BaseElevationModel.java:99)
at org.esa.snap.idepix.avhrr.AbstractAvhrrClassificationOp.computeGetasseAltitude(AbstractAvhrrClassificationOp.java:376)
at org.esa.snap.idepix.avhrr.AvhrrTimelineClassificationOp.runAvhrrAlgorithm(AvhrrTimelineClassificationOp.java:105)
at org.esa.snap.idepix.avhrr.AbstractAvhrrClassificationOp.computePixel(AbstractAvhrrClassificationOp.java:161)

Environment

None

Status

Assignee

Luis Veci

Reporter

Marco Peters

Labels

None

Components

Affects versions

Priority

Major
Configure