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/11/22 10:04:28 UTC

[sis] 02/03: Fix a few warnings.

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 e707f8db8beddd3951ff72ddb5ccb1e00d71d3d1
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Mon Nov 21 12:19:05 2022 +0100

    Fix a few warnings.
---
 .../src/test/java/org/apache/sis/metadata/MetadataStandardTest.java   | 2 +-
 .../org/apache/sis/internal/referencing/j2d/AffineTransform2D.java    | 4 +++-
 .../org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java  | 1 +
 .../src/main/java/org/apache/sis/io/wkt/WKTFormat.java                | 2 ++
 .../main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java   | 2 +-
 5 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java b/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
index 9a597ed21a..222844064e 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
@@ -183,7 +183,7 @@ public final strictfp class MetadataStandardTest extends TestCase {
     @Test
     @DependsOnMethod("testGetInterface")
     public void testGetWrongInterface() {
-        standard = new MetadataStandard("SIS", "org.apache.sis.dummy.", null);
+        standard = new MetadataStandard("SIS", "org.apache.sis.dummy.", (MetadataStandard[]) null);
         try {
             getInterface(DefaultCitation.class);
             fail("No dummy interface expected.");
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java
index 3204e6ded9..690abc86b1 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/AffineTransform2D.java
@@ -165,8 +165,10 @@ public class AffineTransform2D extends ImmutableAffineTransform
      *
      * <p>The inconsistency is in the use of {@link Double#doubleToLongBits(double)} for hash code and
      * {@code ==} for testing equality. The former is sensitive to the sign of 0 while the latter is not.</p>
+     *
+     * <a href="https://bugs.openjdk.org/browse/JDK-8290973">JDK-8290973</a>
      */
-    @Workaround(library="JDK", version="8")                         // Last verified in 1.8.0_05.
+    @Workaround(library="JDK", version="8", fixed="20")
     private static double pz(final double value) {
         return (value != 0) ? value : 0;
     }
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java
index e2e1fb796c..4060427b9f 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java
@@ -56,6 +56,7 @@ public final class ParameterizedAffine extends AffineTransform2D {
     /**
      * The (presumed immutable) parameters used for creating this transform.
      */
+    @SuppressWarnings("serial")         // Not statically typed as Serializable.
     private final ParameterValueGroup parameters;
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/WKTFormat.java b/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
index 975fbfd0df..f98baa586f 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
@@ -170,6 +170,7 @@ public class WKTFormat extends CompoundFormat<Object> {
      * The preferred authority for objects or parameter names. A {@code null} value
      * means that the authority shall be inferred from the {@linkplain #convention}.
      */
+    @SuppressWarnings("serial")         // Not statically typed as Serializable.
     private Citation authority;
 
     /**
@@ -227,6 +228,7 @@ public class WKTFormat extends CompoundFormat<Object> {
      *
      * @see #fragments(boolean)
      */
+    @SuppressWarnings("serial")         // Not statically typed as Serializable.
     private Map<String,StoredTree> fragments;
 
     /**
diff --git a/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java b/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java
index 07c82ce27a..8bd27088a9 100644
--- a/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java
+++ b/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java
@@ -207,7 +207,7 @@ final class VariableInfo extends Variable implements Comparable<VariableInfo> {
         this.attributeNames = attributeNames;
         final Object isUnsigned = getAttributeValue(CDM.UNSIGNED, "_unsigned");
         if (isUnsigned instanceof String) {
-            dataType = dataType.unsigned(Boolean.valueOf((String) isUnsigned));
+            dataType = dataType.unsigned(Boolean.parseBoolean((String) isUnsigned));
         }
         this.dataType = dataType;
         /*