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 2015/02/05 18:28:03 UTC
svn commit: r1657632 - in /sis/trunk:
core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
Author: desruisseaux
Date: Thu Feb 5 17:28:03 2015
New Revision: 1657632
URL: http://svn.apache.org/r1657632
Log:
Fix a regression discovered during the release process.
Modified:
sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java?rev=1657632&r1=1657631&r2=1657632&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] Thu Feb 5 17:28:03 2015
@@ -306,9 +306,11 @@ public class DefaultBand extends Default
/**
* Sets the units of data as a unit of length.
*
- * <div class="warning"><b>Upcoming API change — generalization</b><br>
- * As of ISO 19115:2014, the units of wavelength is rather {@code boundUnits}.
- * The restriction for units of length in this {@code units} property may be relaxed in GeoAPI 4.0.
+ * <div class="warning"><b>Upcoming precondition change — relaxation</b><br>
+ * The current implementation requires the unit to be an instance of {@code Unit<Length>},
+ * otherwise a {@link ClassCastException} is thrown. This is because the value returned by
+ * {@link #getUnits()} was restricted by ISO 19115:2003 to units of length.
+ * However this restriction may be relaxed in GeoAPI 4.0.
* </div>
*
* @param newValue The new units of data as an instance of {@code Unit<Length>}.
Modified: sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java?rev=1657632&r1=1657631&r2=1657632&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java [UTF-8] Thu Feb 5 17:28:03 2015
@@ -875,7 +875,7 @@ final class MetadataReader {
final String units = variable.getUnitsString();
if (units != null) try {
band.setUnits(Units.valueOf(units));
- } catch (IllegalArgumentException e) {
+ } catch (RuntimeException e) { // IllegalArgumentException or ClassCastException (specific to this branch).
decoder.listeners.warning(errors().getString(Errors.Keys.CanNotAssignUnitToDimension_2, name, units), e);
}
return band;