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
The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
new f1e6e58241 Fix an error message (wrong resource used).
f1e6e58241 is described below
commit f1e6e58241148771840ae78bd04a61067ce7bc96
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Mon Jul 8 17:04:43 2024 +0200
Fix an error message (wrong resource used).
---
.../main/org/apache/sis/io/wkt/Element.java | 5 +++--
.../main/org/apache/sis/referencing/internal/Resources.java | 4 ++--
.../main/org/apache/sis/referencing/internal/Resources.properties | 2 +-
.../main/org/apache/sis/referencing/internal/Resources_fr.properties | 2 +-
.../referencing/operation/transform/MathTransformFactoryMock.java | 5 +++--
5 files changed, 10 insertions(+), 8 deletions(-)
diff --git
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/Element.java
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/Element.java
index d572f2d97e..af323210cd 100644
---
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/Element.java
+++
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/io/wkt/Element.java
@@ -406,8 +406,9 @@ final class Element {
* @return the exception to be thrown.
*/
final ParseException parseFailed(final Exception cause) {
- return new UnparsableObjectException(errorLocale,
Resources.Keys.CannotParseElement_2,
- new String[] {keyword, Exceptions.getLocalizedMessage(cause,
errorLocale)}, offset).initCause(cause);
+ String message =
Resources.forLocale(errorLocale).getString(Resources.Keys.CannotParseElement_1,
keyword);
+ message = message + ' ' + Exceptions.getLocalizedMessage(cause,
errorLocale);
+ return new UnparsableObjectException(message, offset).initCause(cause);
}
/**
diff --git
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/Resources.java
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/Resources.java
index dbe366e214..2e817d8ba6 100644
---
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/Resources.java
+++
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/Resources.java
@@ -168,9 +168,9 @@ public class Resources extends IndexedResourceBundle {
public static final short CanNotUseGeodeticParameters_2 = 9;
/**
- * Cannot parse the “{0}” element: {1}
+ * Cannot parse the “{0}” element:
*/
- public static final short CannotParseElement_2 = 101;
+ public static final short CannotParseElement_1 = 101;
/**
* Axis directions {0} and {1} are colinear.
diff --git
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/Resources.properties
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/Resources.properties
index 58c5197c6a..ad84e280f7 100644
---
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/Resources.properties
+++
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/Resources.properties
@@ -22,7 +22,7 @@
# Information messages or non-fatal warnings
#
AmbiguousEllipsoid_1 = Ambiguity between inverse flattening and
semi minor axis length for \u201c{0}\u201d. Using inverse flattening.
-CannotParseElement_2 = Cannot parse the \u201c{0}\u201d element:
{1}
+CannotParseElement_1 = Cannot parse the \u201c{0}\u201d element:
ConformanceMeansDatumShift = This result indicates if a datum shift
method has been applied.
ConstantProjParameterValue_1 = This parameter is shown for completeness,
but should never have a value different than {0} for this projection.
DeprecatedCode_3 = Code \u201c{0}\u201d is deprecated and
replaced by code {1}. Reason is: {2}
diff --git
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/Resources_fr.properties
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/Resources_fr.properties
index 29b2e165fe..231807e5bd 100644
---
a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/Resources_fr.properties
+++
b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/Resources_fr.properties
@@ -27,7 +27,7 @@
# Information messages or non-fatal warnings
#
AmbiguousEllipsoid_1 = Ambigu\u00eft\u00e9 entre
l\u2019aplatissement et la longueur du semi-axe mineur pour
\u00ab\u202f{0}\u202f\u00bb. Utilise l\u2019aplatissement.
-CannotParseElement_2 = Ne peut pas d\u00e9coder
l\u2019\u00e9l\u00e9ment \u00ab\u202f{0}\u202f\u00bb\u00a0: {1}
+CannotParseElement_1 = Ne peut pas d\u00e9coder
l\u2019\u00e9l\u00e9ment \u00ab\u202f{0}\u202f\u00bb\u00a0:
ConformanceMeansDatumShift = Ce r\u00e9sultat indique si un changement
de r\u00e9f\u00e9rentiel a \u00e9t\u00e9 appliqu\u00e9.
ConstantProjParameterValue_1 = Ce param\u00e8tre est montr\u00e9 pour
\u00eatre plus complet, mais sa valeur ne devrait jamais \u00eatre
diff\u00e9rente de {0} pour cette projection.
DeprecatedCode_3 = Le code \u00ab\u202f{0}\u202f\u00bb est
d\u00e9pr\u00e9ci\u00e9 et remplac\u00e9 par le code {1}. La raison est\u00a0:
{2}
diff --git
a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/MathTransformFactoryMock.java
b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/MathTransformFactoryMock.java
index 0a9459255d..9ac5cca778 100644
---
a/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/MathTransformFactoryMock.java
+++
b/endorsed/src/org.apache.sis.referencing/test/org/apache/sis/referencing/operation/transform/MathTransformFactoryMock.java
@@ -24,9 +24,10 @@ import org.opengis.metadata.citation.Citation;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.cs.CoordinateSystem;
+import org.opengis.referencing.operation.Matrix;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.MathTransformFactory;
-import org.opengis.referencing.operation.Matrix;
+import org.opengis.referencing.operation.Conversion;
import org.opengis.referencing.operation.OperationMethod;
import org.opengis.referencing.operation.SingleOperation;
import org.apache.sis.referencing.operation.provider.AbstractProvider;
@@ -93,7 +94,7 @@ public final class MathTransformFactoryMock implements
MathTransformFactory {
*/
@Override
public Set<OperationMethod> getAvailableMethods(Class<? extends
SingleOperation> type) {
- return type.isInstance(method) ? Set.of(method) : Set.of();
+ return type.isAssignableFrom(Conversion.class) ? Set.of(method) :
Set.of();
}
/**