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 2016/04/20 16:53:33 UTC
svn commit: r1740152 [7/8] - in /sis/branches/JDK6: ./ core/sis-feature/
core/sis-feature/src/main/java/org/apache/sis/feature/
core/sis-feature/src/main/java/org/apache/sis/internal/
core/sis-feature/src/main/java/org/apache/sis/internal/feature/ core...
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/ReferencingAssert.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -35,6 +35,7 @@ import org.opengis.referencing.cs.Coordi
import org.opengis.referencing.cs.RangeMeaning;
import org.opengis.util.GenericName;
import org.apache.sis.geometry.AbstractEnvelope;
+import org.apache.sis.geometry.Envelopes;
import org.apache.sis.geometry.GeneralDirectPosition;
import org.apache.sis.metadata.iso.citation.Citations;
import org.apache.sis.referencing.IdentifiedObjects;
@@ -54,7 +55,7 @@ import org.apache.sis.internal.jdk8.JDK8
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
- * @version 0.6
+ * @version 0.7
* @module
*/
public strictfp class ReferencingAssert extends MetadataAssert {
@@ -69,8 +70,8 @@ public strictfp class ReferencingAssert
* The authority is expected to be {@link Citations#OGC}. We expect the exact same authority
* instance because identifiers in OGC namespace are often hard-coded in SIS.
*
- * @param expected The expected identifier code.
- * @param actual The identifier to verify.
+ * @param expected the expected identifier code.
+ * @param actual the identifier to verify.
*
* @since 0.6
*/
@@ -87,8 +88,8 @@ public strictfp class ReferencingAssert
* Asserts that the given identifier has the expected code and the {@code "EPSG"} code space.
* The authority is expected to have the {@code "EPSG"} title, alternate title or identifier.
*
- * @param expected The expected identifier code.
- * @param actual The identifier to verify.
+ * @param expected the expected identifier code.
+ * @param actual the identifier to verify.
*
* @since 0.5
*/
@@ -106,14 +107,14 @@ public strictfp class ReferencingAssert
* No other identifier than the given one is expected. The authority is expected to have the {@code "EPSG"} title,
* alternate title or identifier.
*
- * @param name The expected EPSG name.
- * @param identifier The expected EPSG identifier.
- * @param object The object to verify.
+ * @param name the expected EPSG name.
+ * @param identifier the expected EPSG identifier.
+ * @param object the object to verify.
*
* @since 0.6
*/
public static void assertEpsgNameAndIdentifierEqual(final String name, final int identifier, final IdentifiedObject object) {
- assertNotNull(object);
+ assertNotNull(name, object);
assertEpsgIdentifierEquals(name, object.getName());
assertEpsgIdentifierEquals(String.valueOf(identifier), TestUtilities.getSingleton(object.getIdentifiers()));
}
@@ -122,8 +123,8 @@ public strictfp class ReferencingAssert
* Asserts that the tip of the unique alias of the given object is equals to the expected value.
* As a special case if the expected value is null, then this method verifies that the given object has no alias.
*
- * @param expected The expected alias, or {@code null} if we expect no alias.
- * @param object The object for which to test the alias.
+ * @param expected the expected alias, or {@code null} if we expect no alias.
+ * @param object the object for which to test the alias.
*/
public static void assertAliasTipEquals(final String expected, final IdentifiedObject object) {
final Collection<GenericName> aliases = object.getAlias();
@@ -137,14 +138,14 @@ public strictfp class ReferencingAssert
/**
* Compares the given coordinate system axis against the expected values.
*
- * @param name The expected axis name code.
- * @param abbreviation The expected axis abbreviation.
- * @param direction The expected axis direction.
- * @param minimumValue The expected axis minimal value.
- * @param maximumValue The expected axis maximal value.
- * @param unit The expected axis unit of measurement.
- * @param rangeMeaning The expected axis range meaning.
- * @param axis The axis to verify.
+ * @param name the expected axis name code.
+ * @param abbreviation the expected axis abbreviation.
+ * @param direction the expected axis direction.
+ * @param minimumValue the expected axis minimal value.
+ * @param maximumValue the expected axis maximal value.
+ * @param unit the expected axis unit of measurement.
+ * @param rangeMeaning the expected axis range meaning.
+ * @param axis the axis to verify.
*/
public static void assertAxisEquals(final String name, final String abbreviation, final AxisDirection direction,
final double minimumValue, final double maximumValue, final Unit<?> unit, final RangeMeaning rangeMeaning,
@@ -164,9 +165,9 @@ public strictfp class ReferencingAssert
* a positive delta. Only the elements in the given descriptor are compared, and
* the comparisons are done in the units declared in the descriptor.
*
- * @param expected The expected parameter values.
- * @param actual The actual parameter values.
- * @param tolerance The tolerance threshold for comparison of numerical values.
+ * @param expected the expected parameter values.
+ * @param actual the actual parameter values.
+ * @param tolerance the tolerance threshold for comparison of numerical values.
*/
public static void assertParameterEquals(final ParameterValueGroup expected,
final ParameterValueGroup actual, final double tolerance)
@@ -199,13 +200,13 @@ public strictfp class ReferencingAssert
* to the given values. The matrix doesn't need to be square. The last row is handled especially
* if the {@code affine} argument is {@code true}.
*
- * @param expected The values which are expected on the diagonal. If the length of this array
- * is less than the matrix size, then the last element in the array is repeated
- * for all remaining diagonal elements.
- * @param affine If {@code true}, then the last row is expected to contains the value 1
- * in the last column, and all other columns set to 0.
- * @param matrix The matrix to test.
- * @param tolerance The tolerance threshold while comparing floating point values.
+ * @param expected the values which are expected on the diagonal. If the length of this array
+ * is less than the matrix size, then the last element in the array is repeated
+ * for all remaining diagonal elements.
+ * @param affine if {@code true}, then the last row is expected to contains the value 1
+ * in the last column, and all other columns set to 0.
+ * @param matrix the matrix to test.
+ * @param tolerance the tolerance threshold while comparing floating point values.
*/
public static void assertDiagonalEquals(final double[] expected, final boolean affine,
final Matrix matrix, final double tolerance)
@@ -234,9 +235,9 @@ public strictfp class ReferencingAssert
/**
* Compares two affine transforms for equality.
*
- * @param expected The expected affine transform.
- * @param actual The actual affine transform.
- * @param tolerance The tolerance threshold.
+ * @param expected the expected affine transform.
+ * @param actual the actual affine transform.
+ * @param tolerance the tolerance threshold.
*/
public static void assertTransformEquals(final AffineTransform expected, final AffineTransform actual, final double tolerance) {
assertEquals("scaleX", expected.getScaleX(), actual.getScaleX(), tolerance);
@@ -250,10 +251,10 @@ public strictfp class ReferencingAssert
/**
* Asserts that two rectangles have the same location and the same size.
*
- * @param expected The expected rectangle.
- * @param actual The rectangle to compare with the expected one.
- * @param tolx The tolerance threshold on location along the <var>x</var> axis.
- * @param toly The tolerance threshold on location along the <var>y</var> axis.
+ * @param expected the expected rectangle.
+ * @param actual the rectangle to compare with the expected one.
+ * @param tolx the tolerance threshold on location along the <var>x</var> axis.
+ * @param toly the tolerance threshold on location along the <var>y</var> axis.
*/
public static void assertRectangleEquals(final RectangularShape expected,
final RectangularShape actual, final double tolx, final double toly)
@@ -269,6 +270,36 @@ public strictfp class ReferencingAssert
}
/**
+ * Asserts that two envelopes have the same minimum and maximum ordinates.
+ * This method ignores the envelope type (i.e. the implementation class) and the CRS.
+ *
+ * @param expected the expected envelope.
+ * @param actual the envelope to compare with the expected one.
+ * @param tolerances the tolerance threshold on location along each axis. If this array length is shorter
+ * than the number of dimensions, then the last tolerance is reused for all remaining axes.
+ * If this array is empty, then the tolerance threshold is zero.
+ *
+ * @since 0.7
+ */
+ public static void assertEnvelopeEquals(final Envelope expected, final Envelope actual, final double... tolerances) {
+ final int dimension = expected.getDimension();
+ assertEquals("dimension", dimension, actual.getDimension());
+ double tolerance = 0;
+ for (int i=0; i<dimension; i++) {
+ if (i < tolerances.length) {
+ tolerance = tolerances[i];
+ }
+ if (abs(expected.getMinimum(i) - actual.getMinimum(i)) > tolerance ||
+ abs(expected.getMaximum(i) - actual.getMaximum(i)) > tolerance)
+ {
+ fail("Envelopes are not equal:\n"
+ + "expected " + Envelopes.toString(expected) + "\n"
+ + " but got " + Envelopes.toString(actual));
+ }
+ }
+ }
+
+ /**
* Tests if the given {@code outer} shape contains the given {@code inner} rectangle.
* This method will also verify class consistency by invoking the {@code intersects}
* method, and by interchanging the arguments.
@@ -276,8 +307,8 @@ public strictfp class ReferencingAssert
* <p>This method can be used for testing the {@code outer} implementation -
* it should not be needed for standard JDK implementations.</p>
*
- * @param outer The shape which is expected to contains the given rectangle.
- * @param inner The rectangle which should be contained by the shape.
+ * @param outer the shape which is expected to contains the given rectangle.
+ * @param inner the rectangle which should be contained by the shape.
*/
public static void assertContains(final RectangularShape outer, final Rectangle2D inner) {
assertTrue("outer.contains(inner)", outer.contains (inner));
@@ -295,8 +326,8 @@ public strictfp class ReferencingAssert
* This method will also verify class consistency by invoking the {@code intersects}
* method, and by interchanging the arguments.
*
- * @param outer The envelope which is expected to contains the given inner envelope.
- * @param inner The envelope which should be contained by the outer envelope.
+ * @param outer the envelope which is expected to contains the given inner envelope.
+ * @param inner the envelope which should be contained by the outer envelope.
*/
public static void assertContains(final AbstractEnvelope outer, final Envelope inner) {
assertTrue("outer.contains(inner)", outer.contains (inner, true));
@@ -325,8 +356,8 @@ public strictfp class ReferencingAssert
* <p>This method can be used for testing the {@code r1} implementation - it should not
* be needed for standard implementations.</p>
*
- * @param r1 The first shape to test.
- * @param r2 The second rectangle to test.
+ * @param r1 the first shape to test.
+ * @param r2 the second rectangle to test.
*/
public static void assertDisjoint(final RectangularShape r1, final Rectangle2D r2) {
assertFalse("r1.intersects(r2)", r1.intersects(r2));
@@ -358,8 +389,8 @@ public strictfp class ReferencingAssert
* This method will also verify class consistency by invoking the {@code contains} method,
* and by interchanging the arguments.
*
- * @param e1 The first envelope to test.
- * @param e2 The second envelope to test.
+ * @param e1 the first envelope to test.
+ * @param e2 the second envelope to test.
*/
public static void assertDisjoint(final AbstractEnvelope e1, final Envelope e2) {
assertFalse("e1.intersects(e2)", e1.intersects(e2, false));
@@ -398,7 +429,7 @@ public strictfp class ReferencingAssert
* Tests if the given transform is the identity transform.
* If the current transform is linear, then this method will also verifies {@link Matrix#isIdentity()}.
*
- * @param transform The transform to test.
+ * @param transform the transform to test.
*
* @since 0.6
*/
@@ -413,7 +444,7 @@ public strictfp class ReferencingAssert
* Tests if the given transform is <strong>not</strong> the identity transform.
* If the current transform is linear, then this method will also verifies {@link Matrix#isIdentity()}.
*
- * @param transform The transform to test.
+ * @param transform the transform to test.
*
* @since 0.6
*/
Modified: sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -112,6 +112,7 @@ import org.junit.BeforeClass;
org.apache.sis.referencing.operation.transform.ScaleTransformTest.class,
org.apache.sis.referencing.operation.transform.ProjectiveTransformTest.class,
org.apache.sis.referencing.operation.transform.LinearTransformTest.class,
+ org.apache.sis.referencing.operation.transform.LinearInterpolator1DTest.class,
org.apache.sis.referencing.operation.transform.ExponentialTransform1DTest.class,
org.apache.sis.referencing.operation.transform.LogarithmicTransform1DTest.class,
org.apache.sis.referencing.operation.transform.CopyTransformTest.class,
@@ -147,7 +148,7 @@ import org.junit.BeforeClass;
org.apache.sis.internal.referencing.provider.NADCONTest.class,
org.apache.sis.internal.referencing.provider.MapProjectionTest.class,
org.apache.sis.internal.referencing.provider.TransverseMercatorTest.class,
- org.apache.sis.internal.referencing.provider.AllProvidersTest.class,
+ org.apache.sis.internal.referencing.provider.ProvidersTest.class,
org.apache.sis.referencing.operation.transform.InterpolatedTransformTest.class,
org.apache.sis.referencing.operation.transform.InterpolatedGeocentricTransformTest.class,
org.apache.sis.referencing.operation.transform.InterpolatedMolodenskyTransformTest.class,
@@ -170,7 +171,6 @@ import org.junit.BeforeClass;
org.apache.sis.referencing.operation.SingleOperationMarshallingTest.class,
org.apache.sis.referencing.operation.DefaultPassThroughOperationTest.class,
org.apache.sis.referencing.operation.DefaultConcatenatedOperationTest.class,
- org.apache.sis.referencing.operation.CoordinateOperationInferenceTest.class,
org.apache.sis.referencing.crs.DefaultProjectedCRSTest.class,
org.apache.sis.referencing.crs.DefaultDerivedCRSTest.class,
org.apache.sis.referencing.crs.SubTypesTest.class,
@@ -216,6 +216,13 @@ import org.junit.BeforeClass;
org.apache.sis.referencing.AuthorityFactoriesTest.class,
org.apache.sis.referencing.CRSTest.class,
+ // Coordinate operation finders are last, since they need everything else.
+ org.apache.sis.referencing.operation.CoordinateOperationRegistryTest.class,
+ org.apache.sis.referencing.operation.CoordinateOperationFinderTest.class,
+ org.apache.sis.referencing.operation.DefaultCoordinateOperationFactoryTest.class,
+ org.apache.sis.referencing.operation.builder.LinearTransformBuilderTest.class,
+
+ // Geometry
org.apache.sis.geometry.AbstractDirectPositionTest.class,
org.apache.sis.geometry.GeneralDirectPositionTest.class,
org.apache.sis.geometry.DirectPosition1DTest.class,
@@ -227,11 +234,10 @@ import org.junit.BeforeClass;
org.apache.sis.geometry.Envelope2DTest.class,
org.apache.sis.geometry.CurveExtremumTest.class,
org.apache.sis.geometry.EnvelopesTest.class,
+ org.apache.sis.internal.referencing.ServicesForMetadataTest.class,
org.apache.sis.distance.LatLonPointRadiusTest.class, // Pending refactoring in a geometry package.
- org.apache.sis.referencing.operation.builder.LinearTransformBuilderTest.class,
- org.apache.sis.internal.referencing.ServicesForMetadataTest.class,
org.apache.sis.test.integration.DatumShiftTest.class,
org.apache.sis.test.integration.MetadataTest.class,
org.apache.sis.test.integration.ConsistencyTest.class
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -153,7 +153,7 @@ abstract class StringConverter<T> extend
*/
public static final class Number extends StringConverter<java.lang.Number> {
private static final long serialVersionUID = 8356246549731207392L;
- public Number() {super(java.lang.Number.class);} // Instantiated by ServiceLoader.
+ public Number() {super(java.lang.Number.class);} // Instantiated by ServiceLoader.
@Override java.lang.Number doConvert(String source) throws NumberFormatException {
return Numbers.narrowestNumber(source);
@@ -162,7 +162,7 @@ abstract class StringConverter<T> extend
public static final class Double extends StringConverter<java.lang.Double> {
private static final long serialVersionUID = -8576620873911755486L;
- public Double() {super(java.lang.Double.class);} // Instantiated by ServiceLoader.
+ public Double() {super(java.lang.Double.class);} // Instantiated by ServiceLoader.
@Override java.lang.Double doConvert(String source) throws NumberFormatException {
return java.lang.Double.parseDouble(source);
@@ -171,7 +171,7 @@ abstract class StringConverter<T> extend
public static final class Float extends StringConverter<java.lang.Float> {
private static final long serialVersionUID = 2301101264860653956L;
- public Float() {super(java.lang.Float.class);} // Instantiated by ServiceLoader.
+ public Float() {super(java.lang.Float.class);} // Instantiated by ServiceLoader.
@Override java.lang.Float doConvert(String source) throws NumberFormatException {
return java.lang.Float.parseFloat(source);
@@ -180,7 +180,7 @@ abstract class StringConverter<T> extend
public static final class Long extends StringConverter<java.lang.Long> {
private static final long serialVersionUID = 4711495660311641145L;
- public Long() {super(java.lang.Long.class);} // Instantiated by ServiceLoader.
+ public Long() {super(java.lang.Long.class);} // Instantiated by ServiceLoader.
@Override java.lang.Long doConvert(String source) throws NumberFormatException {
return java.lang.Long.parseLong(source);
@@ -189,7 +189,7 @@ abstract class StringConverter<T> extend
public static final class Integer extends StringConverter<java.lang.Integer> {
private static final long serialVersionUID = -5024227987148221073L;
- public Integer() {super(java.lang.Integer.class);} // Instantiated by ServiceLoader.
+ public Integer() {super(java.lang.Integer.class);} // Instantiated by ServiceLoader.
@Override java.lang.Integer doConvert(String source) throws NumberFormatException {
return java.lang.Integer.parseInt(source);
@@ -198,7 +198,7 @@ abstract class StringConverter<T> extend
public static final class Short extends StringConverter<java.lang.Short> {
private static final long serialVersionUID = 4067703596268901375L;
- public Short() {super(java.lang.Short.class);} // Instantiated by ServiceLoader.
+ public Short() {super(java.lang.Short.class);} // Instantiated by ServiceLoader.
@Override java.lang.Short doConvert(String source) throws NumberFormatException {
return java.lang.Short.parseShort(source);
@@ -207,7 +207,7 @@ abstract class StringConverter<T> extend
public static final class Byte extends StringConverter<java.lang.Byte> {
private static final long serialVersionUID = 6934470534898203474L;
- public Byte() {super(java.lang.Byte.class);} // Instantiated by ServiceLoader.
+ public Byte() {super(java.lang.Byte.class);} // Instantiated by ServiceLoader.
@Override java.lang.Byte doConvert(String source) throws NumberFormatException {
return java.lang.Byte.parseByte(source);
@@ -216,7 +216,7 @@ abstract class StringConverter<T> extend
public static final class BigDecimal extends StringConverter<java.math.BigDecimal> {
private static final long serialVersionUID = -5949128086478498785L;
- public BigDecimal() {super(java.math.BigDecimal.class);} // Instantiated by ServiceLoader.
+ public BigDecimal() {super(java.math.BigDecimal.class);} // Instantiated by ServiceLoader.
@Override java.math.BigDecimal doConvert(String source) throws NumberFormatException {
return new java.math.BigDecimal(source);
@@ -225,7 +225,7 @@ abstract class StringConverter<T> extend
public static final class BigInteger extends StringConverter<java.math.BigInteger> {
private static final long serialVersionUID = 6387019773702794255L;
- public BigInteger() {super(java.math.BigInteger.class);} // Instantiated by ServiceLoader.
+ public BigInteger() {super(java.math.BigInteger.class);} // Instantiated by ServiceLoader.
@Override java.math.BigInteger doConvert(String source) throws NumberFormatException {
return new java.math.BigInteger(source);
@@ -234,7 +234,7 @@ abstract class StringConverter<T> extend
public static final class Boolean extends StringConverter<java.lang.Boolean> {
private static final long serialVersionUID = 4689076223535035309L;
- public Boolean() {super(java.lang.Boolean.class);} // Instantiated by ServiceLoader.
+ public Boolean() {super(java.lang.Boolean.class);} // Instantiated by ServiceLoader.
/** See {@link StringConverter} for the conversion table. */
@Override java.lang.Boolean doConvert(final String source) throws UnconvertibleObjectException {
@@ -248,7 +248,7 @@ abstract class StringConverter<T> extend
public static final class Locale extends StringConverter<java.util.Locale> {
private static final long serialVersionUID = -794933131690043494L;
- public Locale() {super(java.util.Locale.class);} // Instantiated by ServiceLoader.
+ public Locale() {super(java.util.Locale.class);} // Instantiated by ServiceLoader.
@Override java.util.Locale doConvert(String source) {
return Locales.parse(source);
@@ -257,7 +257,7 @@ abstract class StringConverter<T> extend
public static final class Charset extends StringConverter<java.nio.charset.Charset> {
private static final long serialVersionUID = 4375157214436581095L;
- public Charset() {super(java.nio.charset.Charset.class);} // Instantiated by ServiceLoader.
+ public Charset() {super(java.nio.charset.Charset.class);} // Instantiated by ServiceLoader.
@Override java.nio.charset.Charset doConvert(String source) throws UnsupportedCharsetException {
return java.nio.charset.Charset.forName(source);
@@ -266,7 +266,7 @@ abstract class StringConverter<T> extend
public static final class File extends StringConverter<java.io.File> {
private static final long serialVersionUID = -2157537605361631529L;
- public File() {super(java.io.File.class);} // Instantiated by ServiceLoader.
+ public File() {super(java.io.File.class);} // Instantiated by ServiceLoader.
@Override java.io.File doConvert(String source) {
return new java.io.File(source);
@@ -275,7 +275,7 @@ abstract class StringConverter<T> extend
public static final class URI extends StringConverter<java.net.URI> {
private static final long serialVersionUID = 7266486748714603336L;
- public URI() {super(java.net.URI.class);} // Instantiated by ServiceLoader.
+ public URI() {super(java.net.URI.class);} // Instantiated by ServiceLoader.
@Override java.net.URI doConvert(String source) throws URISyntaxException {
return new java.net.URI(source);
@@ -284,7 +284,7 @@ abstract class StringConverter<T> extend
public static final class URL extends StringConverter<java.net.URL> {
private static final long serialVersionUID = -6518011235037500143L;
- public URL() {super(java.net.URL.class);} // Instantiated by ServiceLoader.
+ public URL() {super(java.net.URL.class);} // Instantiated by ServiceLoader.
@Override java.net.URL doConvert(String source) throws MalformedURLException {
return new java.net.URL(source);
@@ -294,7 +294,7 @@ abstract class StringConverter<T> extend
public static final class Unit extends StringConverter<javax.measure.unit.Unit<?>> {
private static final long serialVersionUID = -1809497218136016210L;
@SuppressWarnings("unchecked")
- public Unit() {super((Class) javax.measure.unit.Unit.class);} // Instantiated by ServiceLoader.
+ public Unit() {super((Class) javax.measure.unit.Unit.class);} // Instantiated by ServiceLoader.
@Override javax.measure.unit.Unit<?> doConvert(String source) throws IllegalArgumentException {
return Units.valueOf(source);
@@ -303,7 +303,7 @@ abstract class StringConverter<T> extend
public static final class Angle extends StringConverter<org.apache.sis.measure.Angle> {
private static final long serialVersionUID = -6937967772504961327L;
- public Angle() {super(org.apache.sis.measure.Angle.class);} // Instantiated by ServiceLoader.
+ public Angle() {super(org.apache.sis.measure.Angle.class);} // Instantiated by ServiceLoader.
@Override org.apache.sis.measure.Angle doConvert(String source) throws NumberFormatException {
return new org.apache.sis.measure.Angle(source);
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -246,7 +246,7 @@ public final class CollectionsExt extend
return array;
}
}
- throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalPropertyClass_2, name, valueType));
+ throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalPropertyValueClass_2, name, valueType));
}
/**
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -16,8 +16,10 @@
*/
package org.apache.sis.internal.util;
+import java.util.List;
import java.util.Arrays;
import java.util.Iterator;
+import java.util.ServiceLoader;
import java.util.NoSuchElementException;
import org.apache.sis.util.Workaround;
@@ -35,7 +37,8 @@ import org.apache.sis.internal.jdk7.Obje
* a new iteration. See
* {@link org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory#DefaultMathTransformFactory()}.</p>
*
- * <p>Another usage for this class is to prepend some values before the elements given by the source {@code Iterable}.</p>
+ * <p>Some usages for this class are to prepend some values before the elements given by the source {@code Iterable},
+ * or to replace some values when they are loaded.</p>
*
* <p>This class is not thread-safe. Synchronization, if desired, shall be done by the caller.</p>
*
@@ -49,9 +52,9 @@ import org.apache.sis.internal.jdk7.Obje
@Workaround(library="JDK", version="1.8.0_31-b13")
public class LazySet<E> extends SetOfUnknownSize<E> {
/**
- * The original source of elements, or {@code null} if unknown.
+ * The type of service to request with {@link ServiceLoader}, or {@code null} if unknown.
*/
- private final Iterable<? extends E> source;
+ private final Class<E> service;
/**
* The iterator to use for filling this set, or {@code null} if the iteration did not started yet
@@ -82,11 +85,11 @@ public class LazySet<E> extends SetOfUnk
* only when first needed, and at most one iteration will be performed (unless {@link #reload()}
* is invoked).
*
- * @param source The source of elements to use for filling this set.
+ * @param service the type of service to request with {@link ServiceLoader}, or {@code null} if unknown.
*/
- public LazySet(final Iterable<? extends E> source) {
- Objects.requireNonNull(source);
- this.source = source;
+ public LazySet(final Class<E> service) {
+ Objects.requireNonNull(service);
+ this.service = service;
}
/**
@@ -98,23 +101,19 @@ public class LazySet<E> extends SetOfUnk
public LazySet(final Iterator<? extends E> iterator) {
Objects.requireNonNull(iterator);
sourceIterator = iterator;
- source = null;
+ service = null;
createCache();
}
/**
* Notifies this {@code LazySet} that it should re-fetch the elements from the source given at construction time.
- * This method does not verify if the source needs also to be reloaded; it is up to the caller to verify.
- *
- * @return The original source of elements, or {@code null} if unknown.
*/
- public Iterable<? extends E> reload() {
- if (source != null) {
+ public void reload() {
+ if (service != null) {
sourceIterator = null;
cachedElements = null;
numCached = 0;
}
- return source;
}
/**
@@ -156,7 +155,7 @@ public class LazySet<E> extends SetOfUnk
*/
private boolean canPullMore() {
if (sourceIterator == null && cachedElements == null) {
- sourceIterator = source.iterator();
+ sourceIterator = ServiceLoader.load(service).iterator();
if (createCache()) {
return true;
}
@@ -198,11 +197,12 @@ public class LazySet<E> extends SetOfUnk
}
/**
- * Adds the given element to the {@link #cachedElements} array.
+ * Caches a new element. Subclasses can override this method is they want to substitute the given value
+ * by another value.
*
* @param element The element to add to the cache.
*/
- private void cache(final E element) {
+ protected void cache(final E element) {
if (numCached >= cachedElements.length) {
cachedElements = Arrays.copyOf(cachedElements, numCached << 1);
}
@@ -210,6 +210,16 @@ public class LazySet<E> extends SetOfUnk
}
/**
+ * Returns an unmodifiable view over the elements cached so far.
+ * The returned list does not contain any elements that were not yet fetched from the source.
+ *
+ * @return the elements cached so far.
+ */
+ protected final List<E> cached() {
+ return UnmodifiableArrayList.wrap(cachedElements, 0, numCached);
+ }
+
+ /**
* Returns {@code true} if an element exists at the given index.
* The element is not loaded immediately.
*
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedException.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedException.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedException.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -22,13 +22,13 @@ import org.apache.sis.util.Localized;
/**
* An exception which can produce an error message in the given locale.
- * Exceptions implementing this interface uses the following policy:
+ * Exceptions implementing this interface use the following policy:
*
* <ul>
* <li>{@link Throwable#getMessage()} returns the message in the {@linkplain Locale#getDefault() default locale}.
* In a client-server architecture, this is often the locale on the server side.</li>
- * <li>{@link Throwable#getLocalizedMessage()} returns the message in the locale returned by the
- * {@link #getLocale()} method. This is often the locale used by a {@link java.text.Format}
+ * <li>{@link Throwable#getLocalizedMessage()} returns the message in a locale that depends on the context
+ * in which the exception has been thrown. This is often the locale used by a {@link java.text.Format}
* object for example, and can be presumed to be the locale on the client side.</li>
* <li>{@link #getLocalizedMessage(Locale)} returns the message in the given locale.
* This method is specific to Apache SIS however.</li>
@@ -36,29 +36,26 @@ import org.apache.sis.util.Localized;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
- * @version 0.3
+ * @version 0.7
* @module
*
* @see org.apache.sis.util.Exceptions#getLocalizedMessage(Throwable, Locale)
*/
-public interface LocalizedException extends Localized {
+public interface LocalizedException {
/**
- * The locale of the string returned by {@link #getLocalizedMessage()}.
- *
- * @return The locale of the localized exception message.
- */
- @Override
- Locale getLocale();
-
- /**
- * Returns the message in the default locale.
+ * Returns the message in the {@linkplain Locale#getDefault() default locale}.
*
* @return The exception message in the default locale.
*/
String getMessage();
/**
- * Returns the message in the locale specified by {@link #getLocale()}.
+ * Returns the message in the locale that depends on the context in which this exception has been thrown.
+ * For example it may be the local of a client application connected to a distant server.
+ *
+ * <p>If the context locale is known, then this {@code LocalizedException} instance will also implement
+ * the {@link Localized} interface and the context locale can be obtained by a call to
+ * {@link Localized#getLocale()}.</p>
*
* @return The localized exception message.
*/
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedParseException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedParseException.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedParseException.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LocalizedParseException.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -20,6 +20,7 @@ import java.util.Locale;
import java.text.ParsePosition;
import java.text.ParseException;
import org.apache.sis.util.Workaround;
+import org.apache.sis.util.Localized;
import org.apache.sis.util.CharSequences;
import org.apache.sis.util.resources.Errors;
@@ -39,10 +40,10 @@ import org.apache.sis.util.resources.Err
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
- * @version 0.3
+ * @version 0.7
* @module
*/
-public final class LocalizedParseException extends ParseException implements LocalizedException {
+public final class LocalizedParseException extends ParseException implements LocalizedException, Localized {
/**
* For cross-version compatibility.
*/
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -56,8 +56,9 @@ import static org.apache.sis.internal.ut
* {@link #nextPrimeNumber(int) nextPrimeNumber}.
*
* @author Martin Desruisseaux (MPO, IRD, Geomatys)
+ * @author Johann Sorel (Geomatys)
* @since 0.3
- * @version 0.6
+ * @version 0.7
* @module
*
* @see DecimalFunctions
@@ -132,6 +133,7 @@ public final class MathFunctions extends
*
* @see #primeNumberAt(int)
*/
+ @SuppressWarnings("VolatileArrayField") // Because we will not modify array content.
private static volatile short[] primes = new short[] {2, 3};
/**
@@ -543,8 +545,7 @@ public final class MathFunctions extends
/**
* Returns a {@linkplain Float#isNaN(float) NaN} number for the specified ordinal value.
- * Valid NaN numbers in Java can have bit fields in the ranges listed below.
- * This method allocates one of valid NaN bit fields to each ordinal value.
+ * Valid NaN numbers in Java can have bit fields in the ranges listed below:
*
* <ul>
* <li>[{@code 0x7F800001} … {@code 0x7FFFFFFF}], with
@@ -552,9 +553,12 @@ public final class MathFunctions extends
* <li>[{@code 0xFF800001} … {@code 0xFFFFFFFF}]</li>
* </ul>
*
- * The relationship between bit fields and ordinal values is implementation dependent and may
- * change in any future version of the SIS library. The current implementation restricts the
- * range of allowed ordinal values to a smaller one than the range of all possible NaN values.
+ * Some of those bits, named the <cite>payload</cite>, can be used for storing custom information.
+ * This method maps some of the payload values to each ordinal value.
+ *
+ * <p>The relationship between payload values and ordinal values is implementation dependent and
+ * may change in any future version of the SIS library. The current implementation restricts the
+ * range of allowed ordinal values to a smaller one than the range of all possible values.</p>
*
* @param ordinal The NaN ordinal value, from {@code -0x200000} to {@code 0x1FFFFF} inclusive.
* @return One of the legal {@linkplain Float#isNaN(float) NaN} values as a float.
@@ -596,6 +600,68 @@ public final class MathFunctions extends
}
/**
+ * Converts two long bits values containing a IEEE 754 quadruple precision floating point number
+ * to a double precision floating point number. About 17 decimal digits of precision may be lost
+ * due to the {@code double} type having only half the capacity of quadruple precision type.
+ *
+ * <p>Some quadruple precision values can not be represented in double precision and are mapped
+ * to {@code double} values as below:</p>
+ * <ul>
+ * <li>Values having a magnitude less than {@link Double#MIN_VALUE} are mapped to
+ * positive or negative zero.</li>
+ * <li>Values having a magnitude greater than {@link Double#MAX_VALUE} are mapped to
+ * {@link Double#POSITIVE_INFINITY} or {@link Double#NEGATIVE_INFINITY}.</li>
+ * <li>All NaN values are currently collapsed to the single "canonical" {@link Double#NaN} value
+ * (this policy may be revisited in future SIS version).</li>
+ * </ul>
+ *
+ * @param l0 upper part of the quadruple precision floating point number.
+ * @param l1 lower part of the quadruple precision floating point number.
+ * @return double precision approximation.
+ *
+ * @see <a href="https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format">Quadruple-precision floating-point format on Wikipedia</a>
+ *
+ * @since 0.7
+ */
+ public static double quadrupleToDouble(long l0, long l1) {
+ // Build double
+ long sig = (l0 & 0x8000000000000000L);
+ long exp = (l0 & 0x7FFF000000000000L) >> 48;
+ l0 = (l0 & 0x0000FFFFFFFFFFFFL);
+ if (exp == 0) {
+ /*
+ * Subnormal number.
+ * Since we convert them to double precision, subnormal numbers can not be represented
+ * as they are smaller than Double.MIN_VALUE. We map them to zero preserving the sign.
+ */
+ return Double.longBitsToDouble(sig);
+ }
+ if (exp == 0x7FFF) {
+ /*
+ * NaN of infinite number.
+ * Mantissa with all bits at 0 is used for infinite.
+ * This is the only special number that we can preserve.
+ */
+ if (l0 == 0 && l1 == 0) {
+ return Double.longBitsToDouble(sig | 0x7FF0000000000000L);
+ }
+ /*
+ * Other NaN values might have a meaning (e.g. NaN(1) = forest, NaN(2) = lake, etc.)
+ * See above toNanFloat(int) and toNaNOrdinal(float) methods. When truncating the value we
+ * might change the meaning, which could cause several issues later. Therefor we conservatively
+ * collapse all NaNs to the default NaN for now (this may be revisited in a future SIS version).
+ */
+ return Double.NaN;
+ }
+ exp -= (16383 - 1023); //change from 15 bias to 11 bias
+ // Check cases where mantissa excess what double can support
+ if (exp < 0) return Double.NEGATIVE_INFINITY;
+ if (exp > 2046) return Double.POSITIVE_INFINITY;
+
+ return Double.longBitsToDouble(sig | (exp << 52) | (l0 << 4) | (l1 >>> 60));
+ }
+
+ /**
* Returns the <var>i</var><sup>th</sup> prime number.
* This method returns (2, 3, 5, 7, 11, …) for index (0, 1, 2, 3, 4, …).
*
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -285,7 +285,7 @@ public final class Classes extends Stati
*
* @see Class#getInterfaces()
*/
- @SuppressWarnings({"unchecked","rawtypes"}) // Generic array creation.
+ @SuppressWarnings({"unchecked","rawtypes"}) // Generic array creation.
public static <T> Class<? super T>[] getAllInterfaces(final Class<T> type) {
final Set<Class<?>> interfaces = getInterfaceSet(type);
return (interfaces != null) ? interfaces.toArray(new Class[interfaces.size()]) : EMPTY_ARRAY;
@@ -370,10 +370,10 @@ next: for (final Class<?> candidat
for (int i=0; i<count; i++) {
final Class<?> old = types[i];
if (candidate.isAssignableFrom(old)) {
- continue next; // A more specialized interface already exists.
+ continue next; // A more specialized interface already exists.
}
if (old.isAssignableFrom(candidate)) {
- types[i] = candidate; // This interface specializes a previous interface.
+ types[i] = candidate; // This interface specializes a previous interface.
continue next;
}
}
@@ -501,14 +501,14 @@ next: for (final Class<?> candidat
*/
public static Set<Class<?>> findCommonInterfaces(final Class<?> c1, final Class<?> c2) {
final Set<Class<?>> interfaces = getInterfaceSet(c1);
- final Set<Class<?>> buffer = getInterfaceSet(c2); // To be recycled.
+ final Set<Class<?>> buffer = getInterfaceSet(c2); // To be recycled.
if (interfaces == null || buffer == null) {
return Collections.emptySet();
}
interfaces.retainAll(buffer);
for (Iterator<Class<?>> it=interfaces.iterator(); it.hasNext();) {
final Class<?> candidate = it.next();
- buffer.clear(); // Safe because the buffer can not be Collections.EMPTY_SET at this point.
+ buffer.clear(); // Safe because the buffer can not be Collections.EMPTY_SET at this point.
getInterfaceSet(candidate, buffer);
if (interfaces.removeAll(buffer)) {
it = interfaces.iterator();
@@ -561,9 +561,9 @@ cmp: for (final Class<?> c : c1) {
continue cmp;
}
}
- return false; // Interface not found in 'c2'.
+ return false; // Interface not found in 'c2'.
}
- return n == 0; // If n>0, at least one interface was not found in 'c1'.
+ return n == 0; // If n>0, at least one interface was not found in 'c1'.
}
/**
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/Containers.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -243,7 +243,7 @@ public final class Containers extends St
final Object value = properties.get(key);
if (value != null && !type.isInstance(value)) {
throw new IllegalArgumentException(Errors.getResources(properties)
- .getString(Errors.Keys.IllegalPropertyClass_2, key, value.getClass()));
+ .getString(Errors.Keys.IllegalPropertyValueClass_3, key, type, value.getClass()));
}
return (T) value;
}
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecord.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -261,8 +261,8 @@ public class DefaultRecord implements Re
if (value != null) {
final Class<?> valueClass = definition.getValueClass(index);
if (valueClass != null && !valueClass.isInstance(value)) {
- throw new ClassCastException(Errors.format(Errors.Keys.IllegalPropertyClass_2,
- name, value.getClass()));
+ throw new ClassCastException(Errors.format(Errors.Keys.IllegalPropertyValueClass_3,
+ name, valueClass, value.getClass()));
}
}
Array.set(values, index, value);
@@ -287,8 +287,8 @@ public class DefaultRecord implements Re
if (value != null) {
final Class<?> valueClass = definition.getValueClass(i);
if (valueClass != null && !valueClass.isInstance(value)) {
- throw new ClassCastException(Errors.format(Errors.Keys.IllegalPropertyClass_2,
- definition.getName(i), value.getClass()));
+ throw new ClassCastException(Errors.format(Errors.Keys.IllegalPropertyValueClass_3,
+ definition.getName(i), valueClass, value.getClass()));
}
}
Array.set(values, i, value);
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/Types.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -757,7 +757,7 @@ public final class Types extends Static
if (value != null) {
if (!(value instanceof CharSequence)) {
throw new IllegalArgumentException(Errors.getResources(properties)
- .getString(Errors.Keys.IllegalPropertyClass_2, key, value.getClass()));
+ .getString(Errors.Keys.IllegalPropertyValueClass_2, key, value.getClass()));
}
if (i18n == null) {
i18n = (CharSequence) value;
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -454,9 +454,19 @@ public final class Errors extends Indexe
public static final short IllegalParameterValue_2 = 144;
/**
+ * Property “{0}” can not be of type ‘{1}’.
+ */
+ public static final short IllegalPropertyType_2 = 223;
+
+ /**
* Property “{0}” does not accept instances of ‘{1}’.
*/
- public static final short IllegalPropertyClass_2 = 40;
+ public static final short IllegalPropertyValueClass_2 = 40;
+
+ /**
+ * Expected an instance of ‘{1}’ for the “{0}” property, but got an instance of ‘{2}’.
+ */
+ public static final short IllegalPropertyValueClass_3 = 224;
/**
* Range [{0} … {1}] is not valid.
@@ -519,6 +529,11 @@ public final class Errors extends Indexe
public static final short InconsistentTableColumns = 48;
/**
+ * Unit of measurement “{0}” is inconsistent with coordinate system axes.
+ */
+ public static final short InconsistentUnitsForCS_1 = 222;
+
+ /**
* Index {0} is out of bounds.
*/
public static final short IndexOutOfBounds_1 = 49;
@@ -791,6 +806,11 @@ public final class Errors extends Indexe
public static final short NonLinearUnit_1 = 84;
/**
+ * The “{0}” sequence is not monotonic.
+ */
+ public static final short NonMonotonicSequence_1 = 221;
+
+ /**
* Axis directions {0} and {1} are not perpendicular.
*/
public static final short NonPerpendicularDirections_2 = 85;
@@ -981,6 +1001,11 @@ public final class Errors extends Indexe
public static final short UnexpectedCharactersAfter_2 = 198;
/**
+ * Text for ‘{0}’ was expected to {1,choice,0#begin|1#end} with “{2}”, but found “{3}”.
+ */
+ public static final short UnexpectedCharactersAtBound_4 = 225;
+
+ /**
* Unexpected dimension for a coordinate system of type ‘{0}’.
*/
public static final short UnexpectedDimensionForCS_1 = 212;
@@ -1001,6 +1026,11 @@ public final class Errors extends Indexe
public static final short UnexpectedFileFormat_2 = 111;
/**
+ * Expected {1} components in “{0}” but found {2}.
+ */
+ public static final short UnexpectedNumberOfComponents_3 = 226;
+
+ /**
* Parameter “{0}” was not expected.
*/
public static final short UnexpectedParameter_1 = 152;
@@ -1136,7 +1166,8 @@ public final class Errors extends Indexe
public static final short UnspecifiedParameterValues = 185;
/**
- * Can not handle instances of ‘{0}’ because arbitrary implementations are not yet supported.
+ * Can not handle this instance of ‘{0}’ because arbitrary implementations are not yet
+ * supported.
*/
public static final short UnsupportedImplementation_1 = 127;
@@ -1197,9 +1228,9 @@ public final class Errors extends Indexe
/**
* Returns resources in the given locale.
*
- * @param locale The locale, or {@code null} for the default locale.
- * @return Resources in the given locale.
- * @throws MissingResourceException if resources can't be found.
+ * @param locale the locale, or {@code null} for the default locale.
+ * @return resources in the given locale.
+ * @throws MissingResourceException if resources can not be found.
*/
public static Errors getResources(final Locale locale) throws MissingResourceException {
return getBundle(Errors.class, locale);
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] Wed Apr 20 14:53:31 2016
@@ -100,7 +100,9 @@ IllegalOrdinateRange_3 = The
IllegalParameterType_2 = Parameter \u201c{0}\u201d can not be of type \u2018{1}\u2019.
IllegalParameterValue_2 = Parameter \u201c{0}\u201d can not take the \u201c{1}\u201d value.
IllegalParameterValueClass_3 = Parameter \u201c{0}\u201d does not accept values of \u2018{2}\u2019 type. Expected an instance of \u2018{1}\u2019 or derived type.
-IllegalPropertyClass_2 = Property \u201c{0}\u201d does not accept instances of \u2018{1}\u2019.
+IllegalPropertyType_2 = Property \u201c{0}\u201d can not be of type \u2018{1}\u2019.
+IllegalPropertyValueClass_2 = Property \u201c{0}\u201d does not accept instances of \u2018{1}\u2019.
+IllegalPropertyValueClass_3 = Expected an instance of \u2018{1}\u2019 for the \u201c{0}\u201d property, but got an instance of \u2018{2}\u2019.
IllegalRange_2 = Range [{0} \u2026 {1}] is not valid.
IllegalUnicodeCodePoint_2 = Value {1} for \u201c{0}\u201d is not a valid Unicode code point.
IllegalUnitFor_2 = Unit of measurement \u201c{1}\u201d is not valid for \u201c{0}\u201d values.
@@ -113,6 +115,7 @@ IncompatibleUnits_2 = Unit
InconsistentAttribute_2 = Value \u201c{1}\u201d of attribute \u2018{0}\u2019 is inconsistent with other attributes.
InconsistentNamespace_2 = Expected \u201c{0}\u201d namespace for \u201c{1}\u201d.
InconsistentTableColumns = Inconsistent table columns.
+InconsistentUnitsForCS_1 = Unit of measurement \u201c{0}\u201d is inconsistent with coordinate system axes.
IdentifierAlreadyBound_1 = Identifier \u201c{0}\u201d is already associated to another object.
IndexOutOfBounds_1 = Index {0} is out of bounds.
IndicesOutOfBounds_2 = Indices ({0}, {1}) are out of bounds.
@@ -164,6 +167,7 @@ NonInvertibleTransform = Tran
NonAngularUnit_1 = \u201c{0}\u201d is not an angular unit.
NonLinearUnit_1 = \u201c{0}\u201d is not a linear unit.
NonLinearUnitConversion_2 = Unit conversion from \u201c{0}\u201d to \u201c{1}\u201d is non-linear.
+NonMonotonicSequence_1 = The \u201c{0}\u201d sequence is not monotonic.
NonPerpendicularDirections_2 = Axis directions {0} and {1} are not perpendicular.
NonScaleUnit_1 = \u201c{0}\u201d is not a scale unit.
NonTemporalUnit_1 = \u201c{0}\u201d is not a time unit.
@@ -207,10 +211,12 @@ UndefinedOrderingForElements_2 = Orde
UnexpectedArrayLength_2 = Expected an array of length {0}, but got {1}.
UnexpectedChange_1 = Unexpected change in \u2018{0}\u2019.
UnexpectedCharactersAfter_2 = The \u201c{1}\u201d characters after \u201c{0}\u201d was unexpected.
+UnexpectedCharactersAtBound_4 = Text for \u2018{0}\u2019 was expected to {1,choice,0#begin|1#end} with \u201c{2}\u201d, but found \u201c{3}\u201d.
UnexpectedDimensionForCS_1 = Unexpected dimension for a coordinate system of type \u2018{0}\u2019.
UnexpectedEndOfFile_1 = Unexpected end of file while reading \u201c{0}\u201d.
UnexpectedEndOfString_1 = More characters were expected at the end of \u201c{0}\u201d.
UnexpectedFileFormat_2 = File \u201c{1}\u201d seems to be encoded in an other format than {0}.
+UnexpectedNumberOfComponents_3 = Expected {1} components in \u201c{0}\u201d but found {2}.
UnexpectedParameter_1 = Parameter \u201c{0}\u201d was not expected.
UnexpectedTypeForReference_3 = Expected \u201c{0}\u201d to reference an instance of \u2018{1}\u2019, but found an instance of \u2018{2}\u2019.
UnexpectedValueInElement_2 = Unexpected value \u201c{1}\u201d in \u201c{0}\u201d element.
@@ -238,7 +244,7 @@ UnspecifiedCRS = Coor
UnspecifiedDimensions = Dimensions have not been specified.
UnspecifiedFormatForClass_1 = No format is specified for objects of class \u2018{0}\u2019.
UnspecifiedParameterValues = Parameter values have not been specified.
-UnsupportedImplementation_1 = Can not handle instances of \u2018{0}\u2019 because arbitrary implementations are not yet supported.
+UnsupportedImplementation_1 = Can not handle this instance of \u2018{0}\u2019 because arbitrary implementations are not yet supported.
UnsupportedInterpolation_1 = The \u201c{0}\u201d interpolation is unsupported.
UnsupportedOperation_1 = The \u2018{0}\u2019 operation is unsupported.
UnsupportedType_1 = The \u2018{0}\u2019 type is unsupported.
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Wed Apr 20 14:53:31 2016
@@ -97,7 +97,9 @@ IllegalOrdinateRange_3 = La p
IllegalParameterType_2 = Le param\u00e8tre \u00ab\u202f{0}\u202f\u00bb ne peut pas \u00eatre du type \u2018{1}\u2019.
IllegalParameterValue_2 = Le param\u00e8tre \u00ab\u202f{0}\u202f\u00bb n\u2019accepte pas la valeur \u00ab\u202f{1}\u202f\u00bb.
IllegalParameterValueClass_3 = Le param\u00e8tre \u00ab\u202f{0}\u202f\u00bb n\u2019accepte pas les valeurs de type \u2018{2}\u2019. Une instance de \u2018{1}\u2019 ou d\u2019un type d\u00e9riv\u00e9 \u00e9tait attendue.
-IllegalPropertyClass_2 = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019accepte pas les valeurs de type \u2018{1}\u2019.
+IllegalPropertyType_2 = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb ne peut pas \u00eatre du type \u2018{1}\u2019.
+IllegalPropertyValueClass_2 = La propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019accepte pas les valeurs de type \u2018{1}\u2019.
+IllegalPropertyValueClass_3 = Une instance \u2018{1}\u2019 \u00e9tait attendue pour la propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb, mais la valeur donn\u00e9e est une instance de \u2018{2}\u2019.
IllegalRange_2 = La plage [{0} \u2026 {1}] n\u2019est pas valide.
IllegalUnicodeCodePoint_2 = La valeur {1} de \u00ab\u202f{0}\u202f\u00bb n\u2019est pas un code Unicode valide.
IllegalUnitFor_2 = L\u2019unit\u00e9 de mesure \u00ab\u202f{1}\u202f\u00bb n\u2019est pas valide pour les valeurs de \u00ab\u202f{0}\u202f\u00bb.
@@ -110,6 +112,7 @@ IncompatibleUnits_2 = Les
InconsistentAttribute_2 = La valeur \u00ab\u202f{1}\u202f\u00bb de l\u2019attribut \u2018{0}\u2019 n\u2019est pas coh\u00e9rente avec celles des autres attributs.
InconsistentNamespace_2 = L\u2019espace de nom \u201c{0}\u201d \u00e9tait attendu pour \u201c{1}\u201d.
InconsistentTableColumns = Les colonnes des tables ne sont pas coh\u00e9rentes.
+InconsistentUnitsForCS_1 = L\u2019unit\u00e9 de mesure \u00ab\u202f{0}\u202f\u00bb n\u2019est pas coh\u00e9rente avec les axes du syst\u00e8me de coordonn\u00e9es.
IdentifierAlreadyBound_1 = L\u2019identifiant \u00ab\u202f{0}\u202f\u00bb est d\u00e9j\u00e0 associ\u00e9 \u00e0 un autre objet.
IndexOutOfBounds_1 = L\u2019index {0} est en dehors des limites permises.
IndicesOutOfBounds_2 = Les index ({0}, {1}) sont en dehors des limites permises.
@@ -161,6 +164,7 @@ NonInvertibleTransform = La t
NonAngularUnit_1 = \u00ab\u202f{0}\u202f\u00bb n\u2019est pas une unit\u00e9 d\u2019angles.
NonLinearUnit_1 = \u00ab\u202f{0}\u202f\u00bb n\u2019est pas une unit\u00e9 de longueurs.
NonLinearUnitConversion_2 = La conversion des unit\u00e9s \u00ab\u202f{0}\u202f\u00bb vers \u00ab\u202f{1}\u202f\u00bb n\u2019est pas lin\u00e9aire.
+NonMonotonicSequence_1 = La s\u00e9quence \u00ab\u202f{0}\u202f\u00bb n\u2019est pas monotone.
NonPerpendicularDirections_2 = Les directions {0} et {1} ne sont pas perpendiculaires.
NonScaleUnit_1 = \u00ab\u202f{0}\u202f\u00bb n\u2019est pas une unit\u00e9 d\u2019\u00e9chelles.
NonTemporalUnit_1 = \u00ab\u202f{0}\u202f\u00bb n\u2019est pas une unit\u00e9 de temps.
@@ -203,9 +207,11 @@ UndefinedOrderingForElements_2 = L\u2
UnexpectedArrayLength_2 = Un tableau de longueur {0} \u00e9tait attendu, mais le tableau re\u00e7u est de longueur {1}.
UnexpectedChange_1 = Changement inattendu dans \u2018{0}\u2019.
UnexpectedCharactersAfter_2 = Les caract\u00e8res \u00ab\u202f{1}\u202f\u00bb apr\u00e8s \u00ab\u202f{0}\u202f\u00bb sont inattendus.
+UnexpectedCharactersAtBound_4 = Le texte pour \u2018{0}\u2019 devait {1,choice,0#commencer|1#finir} par \u00ab\u202f{2}\u202f\u00bb, mais on a trouv\u00e9 \u00ab\u202f{3}\u202f\u00bb.
UnexpectedDimensionForCS_1 = Dimension inattendue pour un syst\u00e8me de coordonn\u00e9es de type \u2018{0}\u2019.
UnexpectedEndOfFile_1 = Fin de fichier inattendue lors de la lecture de \u00ab\u202f{0}\u202f\u00bb.
UnexpectedEndOfString_1 = D\u2019autres caract\u00e8res \u00e9taient attendus \u00e0 la fin du texte \u00ab\u202f{0}\u202f\u00bb.
+UnexpectedNumberOfComponents_3 = Il y a {2} composantes dans \u00ab\u202f{0}\u202f\u00bb alors qu\u2019on en attendait {1}.
UnexpectedFileFormat_2 = Le fichier \u00ab\u202f{1}\u202f\u00bb semble \u00eatre encod\u00e9 dans un autre format que {0}.
UnexpectedParameter_1 = Le param\u00e8tre \u00ab\u202f{0}\u202f\u00bb est inattendu.
UnexpectedTypeForReference_3 = L\u2019identifiant \u201c{0}\u201d r\u00e9f\u00e9rence une instance de \u2018{2}\u2019 alors qu\u2019on attendait une instance de \u2018{1}\u2019.
@@ -234,7 +240,7 @@ UnparsableStringForClass_2 = Le t
UnparsableStringForClass_3 = Le texte \u00ab\u202f{1}\u202f\u00bb n\u2019est pas reconnu comme un objet de type \u2018{0}\u2019, \u00e0 cause des caract\u00e8res \u00ab\u202f{2}\u202f\u00bb.
UnparsableStringInElement_2 = Le texte \u00ab\u202f{1}\u202f\u00bb dans l\u2019\u00e9l\u00e9ment \u00ab\u202f{0}\u202f\u00bb ne peut pas \u00eatre lu.
UnresolvedFeatureName_1 = L\u2019entit\u00e9 nomm\u00e9e \u00ab\u202f{0}\u202f\u00bb n\u2019a pas encore \u00e9t\u00e9 r\u00e9solue.
-UnsupportedImplementation_1 = Les instances de \u2018{0}\u2019 ne peuvent pas \u00eatre g\u00e9r\u00e9es parce que les impl\u00e9mentations arbitraires ne sont pas encore support\u00e9es.
+UnsupportedImplementation_1 = Cette instance de \u2018{0}\u2019 ne peut pas \u00eatre g\u00e9r\u00e9e parce que les impl\u00e9mentations arbitraires ne sont pas encore support\u00e9es.
UnsupportedInterpolation_1 = L\u2019interpolation \u201c{0}\u201d n\u2019est pas support\u00e9e.
UnsupportedOperation_1 = L\u2019op\u00e9ration \u2018{0}\u2019 n\u2019est pas support\u00e9e.
UnsupportedType_1 = Le type \u2018{0}\u2019 n\u2019est pas support\u00e9.
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -435,7 +435,7 @@ public class IndexedResourceBundle exten
/**
* If the given class is not public, returns the first public interface or the first public super-class.
* This is for avoiding confusing the user with private class in message like "Value can not be instance
- * of XYZ". In the worst case (nothing public other than {@code Object}), returns {@code Object.class}.
+ * of XYZ".
*/
private static Class<?> getPublicType(Class<?> c) {
while (!Modifier.isPublic(c.getModifiers())) {
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -208,6 +208,16 @@ public final class Messages extends Inde
public static final short InsertDuration_2 = 40;
/**
+ * Inverse operation uses this parameter value with opposite sign.
+ */
+ public static final short InverseOperationUsesOppositeSign = 42;
+
+ /**
+ * Inverse operation uses the same parameter value.
+ */
+ public static final short InverseOperationUsesSameSign = 43;
+
+ /**
* No object associated to the “{0}” JNDI name.
*/
public static final short JNDINotSpecified_1 = 32;
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties [ISO-8859-1] Wed Apr 20 14:53:31 2016
@@ -44,6 +44,8 @@ IgnoredPropertyAssociatedTo_1 = Ignor
IgnoredServiceProvider_3 = More than one service provider of type \u2018{0}\u2019 are declared for \u201c{1}\u201d. Only the first provider (an instance of \u2018{2}\u2019) will be used.
IncompleteParsing_1 = Parsing of \u201c{0}\u201d done, but some elements were ignored.
InsertDuration_2 = Inserted {0} records in {1} seconds.
+InverseOperationUsesSameSign = Inverse operation uses the same parameter value.
+InverseOperationUsesOppositeSign = Inverse operation uses this parameter value with opposite sign.
JNDINotSpecified_1 = No object associated to the \u201c{0}\u201d JNDI name.
LoadingDatumShiftFile_1 = Loading datum shift file \u201c{0}\u201d.
LocalesDiscarded = Text were discarded for some locales.
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties [ISO-8859-1] Wed Apr 20 14:53:31 2016
@@ -51,6 +51,8 @@ IgnoredPropertyAssociatedTo_1 = Une p
IgnoredServiceProvider_3 = Plusieurs fournisseurs de service de type \u2018{0}\u2019 sont d\u00e9clar\u00e9s pour \u00ab\u202f{1}\u202f\u00bb. Seul le premier fournisseur (une instance de \u2018{2}\u2019) sera utilis\u00e9.
IncompleteParsing_1 = La lecture de \u00ab\u202f{0}\u202f\u00bb a \u00e9t\u00e9 faite, mais en ignorant certains \u00e9l\u00e9ments.
InsertDuration_2 = {0} enregistrements ont \u00e9t\u00e9 ajout\u00e9s en {1} secondes.
+InverseOperationUsesSameSign = L\u2019op\u00e9ration inverse utilise la m\u00eame valeur pour ce param\u00e8tre.
+InverseOperationUsesOppositeSign = L\u2019op\u00e9ration inverse utilise ce param\u00e8tre avec la valeur de signe oppos\u00e9.
JNDINotSpecified_1 = Aucun objet n\u2019est associ\u00e9 au nom JNDI \u00ab\u202f{0}\u202f\u00bb.
LoadingDatumShiftFile_1 = Chargement du fichier de changement de r\u00e9f\u00e9rentiel \u00ab\u202f{0}\u202f\u00bb.
LocalesDiscarded = Des textes ont \u00e9t\u00e9 ignor\u00e9s pour certaines langues.
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -17,6 +17,7 @@
package org.apache.sis.util.resources;
import java.net.URL;
+import java.util.Map;
import java.util.Locale;
import java.util.MissingResourceException;
import javax.annotation.Generated;
@@ -28,7 +29,7 @@ import org.opengis.util.InternationalStr
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.3
- * @version 0.4
+ * @version 0.7
* @module
*/
public final class Vocabulary extends IndexedResourceBundle {
@@ -191,6 +192,11 @@ public final class Vocabulary extends In
public static final short DefaultValue = 71;
/**
+ * Derived from {0}
+ */
+ public static final short DerivedFrom_1 = 108;
+
+ /**
* Description
*/
public static final short Description = 75;
@@ -626,6 +632,21 @@ public final class Vocabulary extends In
}
/**
+ * Returns resources in the locale specified in the given property map. This convenience method looks
+ * for the {@link #LOCALE_KEY} entry. If the given map is null, or contains no entry for the locale key,
+ * or the value is not an instance of {@link Locale}, then this method fallback on the default locale.
+ *
+ * @param properties the map of properties, or {@code null} if none.
+ * @return resources in the given locale.
+ * @throws MissingResourceException if resources can not be found.
+ *
+ * @since 0.7
+ */
+ public static Vocabulary getResources(final Map<?,?> properties) throws MissingResourceException {
+ return getResources(getLocale(properties));
+ }
+
+ /**
* Gets a string for the given key from this resource bundle or one of its parents.
*
* @param key The key for the desired string.
@@ -633,7 +654,7 @@ public final class Vocabulary extends In
* @throws MissingResourceException If no object for the given key can be found.
*/
public static String format(final short key) throws MissingResourceException {
- return getResources(null).getString(key);
+ return getResources((Locale) null).getString(key);
}
/**
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties [ISO-8859-1] Wed Apr 20 14:53:31 2016
@@ -41,6 +41,7 @@ Datum = Datum
DatumShift = Datum shift
DaylightTime = Daylight time
DefaultValue = Default value
+DerivedFrom_1 = Derived from {0}
Description = Description
Destination = Destination
Dimensions = Dimensions
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties [ISO-8859-1] Wed Apr 20 14:53:31 2016
@@ -48,6 +48,7 @@ Datum = R\u00e9f\u00e9
DatumShift = Changement de r\u00e9f\u00e9rentiel
DaylightTime = Heure normale
DefaultValue = Valeur par d\u00e9faut
+DerivedFrom_1 = D\u00e9riv\u00e9 de {0}
Description = Description
Destination = Destination
Dimensions = Dimensions
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/Pooled.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -342,7 +342,7 @@ abstract class Pooled {
final Object schema = map.get(key);
if (schema != null) {
if (!(schema instanceof String)) {
- throw new PropertyException(Errors.format(Errors.Keys.IllegalPropertyClass_2,
+ throw new PropertyException(Errors.format(Errors.Keys.IllegalPropertyValueClass_2,
name + "[\"" + key + "\"]", value.getClass()));
}
copy.put(key, (String) schema);
@@ -399,7 +399,7 @@ abstract class Pooled {
}
} catch (RuntimeException e) { // (ClassCastException | IllformedLocaleException) on the JDK7 branch.
throw new PropertyException(Errors.format(
- Errors.Keys.IllegalPropertyClass_2, name, value.getClass()), e);
+ Errors.Keys.IllegalPropertyValueClass_2, name, value.getClass()), e);
}
/*
* If we reach this point, the given name is not a SIS property. Try to handle
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/PooledTemplate.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/PooledTemplate.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/PooledTemplate.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/PooledTemplate.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -96,7 +96,7 @@ final class PooledTemplate extends Poole
if (value == null) {
return defaultValue;
}
- throw new PropertyException(Errors.format(Errors.Keys.IllegalPropertyClass_2, name, value.getClass()));
+ throw new PropertyException(Errors.format(Errors.Keys.IllegalPropertyValueClass_2, name, value.getClass()));
}
/**
Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/LazySetTest.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -43,7 +43,7 @@ public final strictfp class LazySetTest
* Creates the set to use for testing purpose.
*/
private static LazySet<String> create() {
- return new LazySet<String>(Arrays.asList(LABELS));
+ return new LazySet<String>(Arrays.asList(LABELS).iterator());
}
/**
Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -35,8 +35,9 @@ import org.apache.sis.internal.jdk8.JDK8
* Tests the {@link MathFunctions} static methods.
*
* @author Martin Desruisseaux (IRD, Geomatys)
+ * @author Johann Sorel (Geomatys)
* @since 0.3
- * @version 0.4
+ * @version 0.7
* @module
*/
@DependsOn({
@@ -259,6 +260,70 @@ public final strictfp class MathFunction
}
/**
+ * Tests the {@link MathFunctions#quadrupleToDouble(long, long)} method. Values used in this test are taken from
+ * <a href="https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format">Quadruple-precision
+ * floating-point format</a> on Wikipedia.
+ */
+ @Test
+ public void testQuadrupleToDouble(){
+ long l0, l1;
+
+ // 1.0
+ l0 = 0x3FFF000000000000L;
+ l1 = 0x0000000000000000L;
+ assertEquals(doubleToLongBits(1.0),
+ doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+ // -2.0
+ l0 = 0xC000000000000000L;
+ l1 = 0x0000000000000000L;
+ assertEquals(doubleToLongBits(-2.0),
+ doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+ // 3.1415926535897932384626433832795028
+ l0 = 0x4000921FB54442D1L;
+ l1 = 0x8469898CC51701B8L;
+ assertEquals(doubleToLongBits(3.1415926535897932384626433832795028),
+ doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+ // ~1/3
+ l0 = 0x3FFD555555555555L;
+ l1 = 0x5555555555555555L;
+ assertEquals(doubleToLongBits(1.0/3.0),
+ doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+ // positive zero
+ l0 = 0x0000000000000000L;
+ l1 = 0x0000000000000000L;
+ assertEquals(doubleToLongBits(+0.0),
+ doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+ // negative zero
+ l0 = 0x8000000000000000L;
+ l1 = 0x0000000000000000L;
+ assertEquals(doubleToLongBits(-0.0),
+ doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+ // positive infinite
+ l0 = 0x7FFF000000000000L;
+ l1 = 0x0000000000000000L;
+ assertEquals(doubleToLongBits(Double.POSITIVE_INFINITY),
+ doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+ // negative infinite
+ l0 = 0xFFFF000000000000L;
+ l1 = 0x0000000000000000L;
+ assertEquals(doubleToLongBits(Double.NEGATIVE_INFINITY),
+ doubleToLongBits(quadrupleToDouble(l0, l1)));
+
+ // a random NaN
+ l0 = 0x7FFF000100040000L;
+ l1 = 0x0001005000080000L;
+ assertEquals(doubleToLongBits(Double.NaN),
+ doubleToLongBits(quadrupleToDouble(l0, l1)));
+ }
+
+ /**
* Tests the {@link MathFunctions#primeNumberAt(int)} method.
*/
@Test
Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java?rev=1740152&r1=1740151&r2=1740152&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestRunner.java [UTF-8] Wed Apr 20 14:53:31 2016
@@ -229,6 +229,7 @@ public final class TestRunner extends Bl
*
* @return The test method to be executed in dependencies order.
*/
+ @SuppressWarnings("ReturnOfCollectionOrArrayField")
private FrameworkMethod[] getFilteredChildren() {
if (filteredChildren == null) {
final List<FrameworkMethod> children = super.getChildren();