sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 03/05: Keep type parameterization on `Node.unwrap(…)` with a minor change for resolving a compiler warning. This is in anticipation for more extensive use of the <G> type parameterization in a future version.
Date Sat, 31 Jul 2021 13:39:42 GMT
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 1d41edce1a7168ccc3f6be0b81123a881bcfa5b5
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Sat Jul 31 14:02:48 2021 +0200

    Keep type parameterization on `Node.unwrap(…)` with a minor change for resolving a compiler
warning.
    This is in anticipation for more extensive use of the <G> type parameterization
in a future version.
---
 .../src/main/java/org/apache/sis/filter/BinaryGeometryFilter.java     | 2 +-
 .../src/main/java/org/apache/sis/internal/filter/Node.java            | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/sis-feature/src/main/java/org/apache/sis/filter/BinaryGeometryFilter.java
b/core/sis-feature/src/main/java/org/apache/sis/filter/BinaryGeometryFilter.java
index c14bb98..50199f0 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/filter/BinaryGeometryFilter.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/filter/BinaryGeometryFilter.java
@@ -152,7 +152,7 @@ abstract class BinaryGeometryFilter<R,G> extends Node implements
SpatialOperator
      * @param  expression  the expression to unwrap.
      * @return the unwrapped expression.
      */
-    protected static <R,G> Expression<? super R, ?> original(final Expression<R,
? extends GeometryWrapper<G>> expression) {
+    protected static <R,G> Expression<? super R, ?> original(final Expression<R,
GeometryWrapper<G>> expression) {
         Expression<? super R, ?> unwrapped = unwrap(expression);
         if (unwrapped instanceof LeafExpression.Transformed<?, ?>) {
             unwrapped = ((LeafExpression.Transformed<R, ?>) unwrapped).original;
diff --git a/core/sis-feature/src/main/java/org/apache/sis/internal/filter/Node.java b/core/sis-feature/src/main/java/org/apache/sis/internal/filter/Node.java
index ea842dc..1560d22 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/internal/filter/Node.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/internal/filter/Node.java
@@ -169,11 +169,11 @@ public abstract class Node implements Serializable {
      * returns the original expression. Otherwise returns the given expression.
      *
      * @param  <R>         the type of resources (e.g. {@link org.opengis.feature.Feature})
used as inputs.
+     * @param  <G>         the geometry implementation type.
      * @param  expression  the expression to unwrap.
      * @return the unwrapped expression.
      */
-    @SuppressWarnings("unchecked")
-    protected static <R> Expression<? super R, ?> unwrap(final Expression<R,
?> expression) {
+    protected static <R,G> Expression<? super R, ?> unwrap(final Expression<R,
GeometryWrapper<G>> expression) {
         if (expression instanceof GeometryConverter<?,?>) {
             return ((GeometryConverter<R,?>) expression).expression;
         } else {

Mime
View raw message