You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2022/05/20 16:46:10 UTC
[sis] 01/05: Add assertions relative to synchronization.
This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git
commit 8da18e9dcbd2d756742d62055ad0788e2ea2e0cd
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Fri May 20 15:24:22 2022 +0200
Add assertions relative to synchronization.
---
ide-project/NetBeans/nbproject/project.properties | 2 +-
.../main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/ide-project/NetBeans/nbproject/project.properties b/ide-project/NetBeans/nbproject/project.properties
index 40225666cc..75deaefe16 100644
--- a/ide-project/NetBeans/nbproject/project.properties
+++ b/ide-project/NetBeans/nbproject/project.properties
@@ -102,7 +102,7 @@ project.GeoAPI = ../../../../GeoAPI/master/ide-project/NetBeans
jsr363.version = 1.0
jaxb.version = 2.3.3
jaxb.runtime = 2.3.6
-istack.version = 3.0.11
+istack.version = 3.0.12
activation.version = 1.2.2
jama.version = 1.0.3
geographlib.version = 2.0
diff --git a/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java b/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
index 23eee30271..001f40e5ba 100644
--- a/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
+++ b/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
@@ -391,6 +391,8 @@ final class ImageFileDirectory extends DataCube {
/**
* Returns {@link #referencing}, created when first needed. We delay its creation since
* this object is not needed for ordinary TIFF files (i.e. without the GeoTIFF extension).
+ * This method is invoked only during the parsing of TIFF tags. If no GeoTIFF information
+ * is found, then this field keeps the {@code null} value.
*/
private GridGeometryBuilder referencing() {
if (referencing == null) {
@@ -1507,6 +1509,7 @@ final class ImageFileDirectory extends DataCube {
*/
@Override
protected SampleModel getSampleModel() throws DataStoreContentException {
+ assert Thread.holdsLock(getSynchronizationLock());
if (sampleModel == null) try {
sampleModel = new SampleModelFactory(getDataType(), tileWidth, tileHeight, samplesPerPixel, bitsPerSample, isPlanar).build();
} catch (IllegalArgumentException | RasterFormatException e) {
@@ -1594,6 +1597,7 @@ final class ImageFileDirectory extends DataCube {
*/
@Override
protected ColorModel getColorModel() throws DataStoreContentException {
+ assert Thread.holdsLock(getSynchronizationLock());
if (colorModel == null) {
final SampleModel sm = getSampleModel();
final int dataType = sm.getDataType();