Skip to content

Commit 352a974

Browse files
committed
Merge master into 3.1.x
2 parents 4b998b7 + 7eff7cf commit 352a974

File tree

3 files changed

+21
-26
lines changed

3 files changed

+21
-26
lines changed

geoapi-conformance/src/main/java/org/opengis/test/Assertions.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,18 +404,33 @@ public static void assertAxisDirectionsEqual(final CoordinateSystem cs, final Ax
404404
}
405405
}
406406

407+
/**
408+
* Asserts that the given matrix is equal to the expected one, with a tolerance of zero.
409+
* Positive zeros are considered equal to negative zeros, and any NaN value is considered equal
410+
* to all other NaN values.
411+
*
412+
* @param expected the expected matrix, which may be {@code null}.
413+
* @param actual the matrix to compare, or {@code null}.
414+
* @param label header of the exception message in case of failure, or {@code null} if none.
415+
*/
416+
public static void assertMatrixEquals(final Matrix expected, final Matrix actual, final String label) {
417+
assertMatrixEquals(expected, actual, 0, label);
418+
}
419+
407420
/**
408421
* Asserts that the given matrix is equal to the expected one, up to the given tolerance value.
422+
* Positive zeros are considered equal to negative zeros, and any NaN value is considered equal
423+
* to all other NaN values.
409424
*
410425
* @param expected the expected matrix, which may be {@code null}.
411426
* @param actual the matrix to compare, or {@code null}.
412427
* @param tolerance the tolerance threshold.
413-
* @param message header of the exception message in case of failure, or {@code null} if none.
428+
* @param label header of the exception message in case of failure, or {@code null} if none.
414429
*
415430
* @see org.opengis.test.referencing.TransformTestCase#assertMatrixEquals(Matrix, Matrix, Matrix, String)
416431
*/
417-
public static void assertMatrixEquals(final Matrix expected, final Matrix actual, final double tolerance, final String message) {
418-
if (isNull(expected, actual, message)) {
432+
public static void assertMatrixEquals(final Matrix expected, final Matrix actual, final double tolerance, final String label) {
433+
if (isNull(expected, actual, label)) {
419434
return;
420435
}
421436
final int numRow = actual.getNumRow();
@@ -427,7 +442,7 @@ public static void assertMatrixEquals(final Matrix expected, final Matrix actual
427442
final double e = expected.getElement(j,i);
428443
final double a = actual.getElement(j,i);
429444
if (!(StrictMath.abs(e - a) <= tolerance) && Double.doubleToLongBits(a) != Double.doubleToLongBits(e)) {
430-
fail(nonNull(message) + "Matrix.getElement(" + j + ", " + i + "): expected " + e + " but got " + a);
445+
fail(nonNull(label) + "Matrix.getElement(" + j + ", " + i + "): expected " + e + " but got " + a);
431446
}
432447
}
433448
}

geoapi/src/main/java/org/opengis/util/Record.java

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,6 @@ default Map<MemberName, Object> getAttributes() {
9999
return getFields();
100100
}
101101

102-
/**
103-
* Returns the value for a field of the specified name.
104-
*
105-
* @param name the name of the field to lookup.
106-
* @return the value of the field for the given name.
107-
*
108-
* @deprecated This method has been removed from the ISO 19103:2015 standard. It has been kept in GeoAPI
109-
* for convenience, but renamed {@link #get(MemberName)} for consistency with common practice.
110-
*/
111-
@Deprecated(since="3.1")
112-
default Object locate(MemberName name) {
113-
return get(name);
114-
}
115-
116102
/**
117103
* Returns the value for a field of the specified name.
118104
* This is functionally equivalent to the following code:
@@ -128,15 +114,9 @@ default Object locate(MemberName name) {
128114
* @return the value of the field for the given name.
129115
*
130116
* @see RecordType#locate(MemberName)
131-
*
132-
* @departure historic
133-
* This method was named {@code locate} in ISO 19103:2005 and removed in ISO 19103:2015.
134-
* It has been kept in GeoAPI as a convenience shortcut for a frequently used operation.
135-
*
136-
* @since 3.1
137117
*/
138118
@UML(identifier="locate", obligation=MANDATORY, specification=ISO_19103, version=2005)
139-
default Object get(MemberName name) {
119+
default Object locate(MemberName name) {
140120
return getFields().get(name);
141121
}
142122

geoapi/src/main/java/org/opengis/util/RecordType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ default Set<MemberName> getMembers() {
189189
* as a shortcut to other methods.
190190
*
191191
* @see #getFieldTypes()
192-
* @see Record#get(MemberName)
192+
* @see Record#locate(MemberName)
193193
*/
194194
@UML(identifier="locate", obligation=MANDATORY, specification=ISO_19103, version=2005)
195195
default TypeName locate(MemberName name) {

0 commit comments

Comments
 (0)