Author: desruisseaux
Date: Sat Mar 31 12:14:13 2018
New Revision: 1828101
URL: http://svn.apache.org/viewvc?rev=1828101&view=rev
Log:
Merge from JDK8 branch.
Added:
sis/trunk/core/sis-portrayal/
- copied from r1828100, sis/branches/JDK8/core/sis-portrayal/
sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/event/
- copied from r1828100,
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/event/
Removed:
sis/trunk/core/sis-build-helper/src/main/resources/org/apache/sis/findbugs-exclude.xml
sis/trunk/ide-project/eclipse/
Modified:
sis/trunk/ (props changed)
sis/trunk/core/pom.xml
sis/trunk/core/sis-build-helper/pom.xml
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/CodeListMarshallingTest.java
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/lan/LanguageCodeTest.java
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/lan/Locales
(legacy).xml (props changed)
sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/lan/Locales.xml
(props changed)
sis/trunk/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/MapLayer.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SpecializableTransform.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/ObjectToString.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/package-info.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListener.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java
sis/trunk/ide-project/NetBeans/build.xml
sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml
sis/trunk/ide-project/NetBeans/nbproject/genfiles.properties
sis/trunk/ide-project/NetBeans/nbproject/project.properties
sis/trunk/ide-project/NetBeans/nbproject/project.xml
sis/trunk/pom.xml
sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractResource.java
sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/URIDataStore.java
sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/folder/Store.java
sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/Resource.java
sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java
sis/trunk/storage/sis-storage/src/test/resources/org/apache/sis/internal/storage/folder/test-data/data1.xml
(props changed)
sis/trunk/storage/sis-storage/src/test/resources/org/apache/sis/internal/storage/folder/test-data/data2.xml
(props changed)
sis/trunk/storage/sis-storage/src/test/resources/org/apache/sis/internal/storage/folder/test-data/data3.xml
(props changed)
sis/trunk/storage/sis-storage/src/test/resources/org/apache/sis/internal/storage/folder/test-data/data4/data5.xml
(props changed)
Propchange: sis/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Mar 31 12:14:13 2018
@@ -2,5 +2,5 @@
/sis/branches/ISO-19115-3:1804459-1825252
/sis/branches/JDK6:1394364-1758914
/sis/branches/JDK7:1394913-1822221
-/sis/branches/JDK8:1584960-1825995
+/sis/branches/JDK8:1584960-1828100
/sis/branches/JDK9:1773327-1803064
Modified: sis/trunk/core/pom.xml
URL:
http://svn.apache.org/viewvc/sis/trunk/core/pom.xml?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/core/pom.xml (original)
+++ sis/trunk/core/pom.xml Sat Mar 31 12:14:13 2018
@@ -193,6 +193,7 @@
<module>sis-referencing-by-identifiers</module>
<module>sis-feature</module>
<module>sis-raster</module>
+ <module>sis-portrayal</module>
</modules>
</project>
Modified: sis/trunk/core/sis-build-helper/pom.xml
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-build-helper/pom.xml?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/core/sis-build-helper/pom.xml (original)
+++ sis/trunk/core/sis-build-helper/pom.xml Sat Mar 31 12:14:13 2018
@@ -111,17 +111,17 @@ Define Maven Mojos and Javadoc taglets f
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
- <version>3.5.0</version>
+ <version>3.5.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
- <version>3.5.0</version>
+ <version>3.5.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
- <version>3.5</version>
+ <version>3.5.1</version>
<scope>provided</scope>
</dependency>
<dependency>
Modified:
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/CodeListMarshallingTest.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/CodeListMarshallingTest.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/CodeListMarshallingTest.java
[UTF-8] (original)
+++
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/CodeListMarshallingTest.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -105,7 +105,7 @@ public final strictfp class CodeListMars
@Test
public void testDefaultURL() throws JAXBException {
final String expected =
getResponsiblePartyXML(Schemas.METADATA_ROOT_LEGACY);
- final ResponsibleParty rp = (ResponsibleParty) XML.unmarshal(expected);
+ final ResponsibleParty rp = unmarshal(ResponsibleParty.class,
expected);
assertEquals(Role.PRINCIPAL_INVESTIGATOR, rp.getRole());
/*
* Use the convenience method in order to avoid the effort of creating
@@ -123,7 +123,7 @@ public final strictfp class CodeListMars
@Test
public void testISO_URL() throws JAXBException {
final String expected =
getResponsiblePartyXML("http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/");
- final ResponsibleParty rp = (ResponsibleParty) XML.unmarshal(expected);
+ final ResponsibleParty rp = unmarshal(ResponsibleParty.class,
expected);
assertEquals(Role.PRINCIPAL_INVESTIGATOR, rp.getRole());
final MarshallerPool pool = getMarshallerPool();
@@ -173,7 +173,7 @@ public final strictfp class CodeListMars
*/
marshaller.setProperty(XML.LOCALE, Locale.FRENCH);
String expected = getCitationXML("fra", "Création", legacy);
- CitationDate ci = (CitationDate) XML.unmarshal(expected);
+ CitationDate ci = unmarshal(CitationDate.class, expected);
assertEquals(DateType.CREATION, ci.getDateType());
String actual = marshal(marshaller, ci);
assertXmlEquals(expected, actual, "xmlns:*");
@@ -182,7 +182,7 @@ public final strictfp class CodeListMars
*/
marshaller.setProperty(XML.LOCALE, Locale.ENGLISH);
expected = getCitationXML("eng", "Creation", legacy);
- ci = (CitationDate) XML.unmarshal(expected);
+ ci = unmarshal(CitationDate.class, expected);
assertEquals(DateType.CREATION, ci.getDateType());
actual = marshal(marshaller, ci);
assertXmlEquals(expected, actual, "xmlns:*");
Modified:
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/lan/LanguageCodeTest.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/lan/LanguageCodeTest.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/lan/LanguageCodeTest.java
[UTF-8] (original)
+++
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/lan/LanguageCodeTest.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -16,7 +16,6 @@
*/
package org.apache.sis.internal.jaxb.lan;
-import org.apache.sis.test.mock.MetadataMock;
import java.util.Map;
import java.util.HashMap;
import java.util.Locale;
@@ -29,8 +28,9 @@ import org.apache.sis.xml.XML;
import org.apache.sis.xml.MarshallerPool;
import org.apache.sis.internal.jaxb.Schemas;
import org.apache.sis.internal.jaxb.LegacyNamespaces;
-import org.apache.sis.test.XMLTestCase;
+import org.apache.sis.test.mock.MetadataMock;
import org.apache.sis.test.DependsOnMethod;
+import org.apache.sis.test.XMLTestCase;
import org.junit.BeforeClass;
import org.junit.AfterClass;
import org.junit.Test;
Modified:
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java
[UTF-8] (original)
+++
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/NameMapTest.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -117,7 +117,7 @@ public final strictfp class NameMapTest
assertEquals("getAverageAirTemperature", name);
assertSame ("getAverageAirTemperature", name);
/*
- * Tests an other intern.
+ * Tests another intern.
*/
map = MetadataStandard.ISO_19115.asNameMap(EnvironmentalRecord.class,
SENTENCE, UML_IDENTIFIER);
name = map.get("Average air temperature");
Modified:
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java
[UTF-8] (original)
+++
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -399,13 +399,13 @@ public abstract strictfp class Annotatio
}
case "satisfiedPlan": {
if
(org.opengis.metadata.acquisition.Requirement.class.isAssignableFrom(enclosing))
{
- name = "satisifiedPlan"; // Mispelling in
ISO 19115-3:2016
+ name = "satisifiedPlan"; // Misspelling in
ISO 19115-3:2016
}
break;
}
case "meteorologicalConditions": {
if
(org.opengis.metadata.acquisition.EnvironmentalRecord.class.isAssignableFrom(enclosing))
{
- name = "meterologicalConditions"; // Mispelling in
ISO 19115-3:2016
+ name = "meterologicalConditions"; // Misspelling in
ISO 19115-3:2016
}
break;
}
Modified:
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
[UTF-8] (original)
+++
sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -42,7 +42,7 @@ import org.apache.sis.util.StringBuilder
/**
- * Compares JAXB annotations against the ISO 19115 schema. This test requires
a connection to
+ * Compares JAXB annotations against the ISO 19115 schemas. This test requires
a connection to
* <a
href="http://standards.iso.org/iso/19115/-3/">http://standards.iso.org/iso/19115/-3/</a>.
* All classes in a given directory are scanned.
*
@@ -169,8 +169,8 @@ public final strictfp class SchemaCompli
}
boolean equal(final Info other) {
- return Objects.equals(typeName, other.typeName)
- && Objects.equals(namespace, other.namespace)
+ return Objects.equals(typeName, other.typeName)
+ && Objects.equals(namespace, other.namespace)
&& isRequired == other.isRequired
&& isCollection == other.isCollection;
}
@@ -476,7 +476,7 @@ public final strictfp class SchemaCompli
/**
* Verifies that the relationship between the name of the given entity and
its type are consistent with
- * OGC/ISO conventions. This method ignore the prefix (e.g. {@code "mdb:"}
in {@code "mdb:MD_Metadata"}).
+ * OGC/ISO conventions. This method ignores the prefix (e.g. {@code
"mdb:"} in {@code "mdb:MD_Metadata"}).
*
* @param enclosing schema or other container where the error happened.
* @param name the class or property name. Example: {@code
"MD_Metadata"}, {@code "citation"}.
Propchange:
sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/lan/Locales
(legacy).xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/lan/Locales
(legacy).xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange:
sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/lan/Locales.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/lan/Locales.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified:
sis/trunk/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/MapLayer.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/MapLayer.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/MapLayer.java
[UTF-8] (original)
+++
sis/trunk/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/MapLayer.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -17,13 +17,13 @@
package org.apache.sis.internal.map;
import org.apache.sis.storage.Resource;
-import org.opengis.style.Style;
+//import org.opengis.style.Style;
/**
* Data (resource) associated to visual representation (symbology).
* Layers are the key elements of a map: they link datas (given by a {@link
Resource})
- * to their visual representation (defined by a {@link Style}).
+ * to their visual representation (defined by a {@code Style}).
* The visual appearance of a layer should be similar with any rendering
engine.
* Some details may very because of different rendering strategies for label
placements, 2D or 3D,
* but the fundamentals aspect of each {@link org.opengis.feature.Feature} or
@@ -47,7 +47,7 @@ public final class MapLayer {
/**
* Visual representation of data.
*/
- private Style style;
+// private Style style;
/**
* Constructs an initially empty map layer.
@@ -89,16 +89,16 @@ public final class MapLayer {
*
* @return description of data visual appearance, or {@code null} if
unspecified.
*/
- public Style getStyle() {
- return style;
- }
+// public Style getStyle() {
+// return style;
+// }
/**
* Sets the visual appearance of the data.
*
* @param style description of data visual appearance, or {@code null}
if unspecified.
*/
- public void setStyle(Style style) {
- this.style = style;
- }
+// public void setStyle(Style style) {
+// this.style = style;
+// }
}
Modified:
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
[UTF-8] (original)
+++
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -700,7 +700,7 @@ public class GeneralEnvelope extends Arr
}
/**
- * Sets this envelope to the intersection if this envelope with the
specified one.
+ * Sets this envelope to the intersection of this envelope with the
specified one.
*
* <div class="section">Pre-conditions</div>
* This method assumes that the specified envelope uses the same CRS than
this envelope.
Modified:
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SpecializableTransform.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SpecializableTransform.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SpecializableTransform.java
[UTF-8] (original)
+++
sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/SpecializableTransform.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -17,6 +17,8 @@
package org.apache.sis.referencing.operation.transform;
import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Objects;
import java.io.Serializable;
@@ -36,7 +38,6 @@ import org.apache.sis.io.wkt.Formatter;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.ComparisonMode;
import org.apache.sis.util.Utilities;
-import org.apache.sis.util.ArraysExt;
/**
@@ -261,31 +262,33 @@ class SpecializableTransform extends Abs
this.global = global;
final int sourceDim = global.getSourceDimensions();
final int targetDim = global.getTargetDimensions();
- int n = 0;
- final SubArea[] areas = new SubArea[specializations.size()];
-next: for (final Map.Entry<Envelope,MathTransform> e :
specializations.entrySet()) {
- final MathTransform tr = e.getValue();
+ final List<SubArea> areas = new ArrayList<>(specializations.size());
+ for (final Map.Entry<Envelope,MathTransform> entry :
specializations.entrySet()) {
+ MathTransform tr = entry.getValue();
ensureDimensionMatches(0, sourceDim, tr.getSourceDimensions());
ensureDimensionMatches(1, targetDim, tr.getTargetDimensions());
- final SubArea area = new SubArea(e.getKey(), tr);
- if (area.getDimension() != sourceDim) {
- throw new
MismatchedDimensionException(Errors.format(Errors.Keys.MismatchedDimension_3,
- "envelope", sourceDim, area.getDimension()));
- }
- for (int i=0; i<n; i++) {
- if (areas[i].addSpecialization(area)) {
- continue next;
- }
- }
- for (int i=0; i<n; i++) {
- if (area.intersects(areas[i])) {
- // Pending implementation of R-Tree in Apache SIS.
- throw new IllegalArgumentException("Current implementation
does not accept overlapping envelopes.");
+ SubArea[] inherited = null;
+ if (tr instanceof SpecializableTransform) {
+ inherited = ((SpecializableTransform) tr).domains;
+ tr = ((SpecializableTransform) tr).global;
+ }
+ final SubArea area = new SubArea(entry.getKey(), tr);
+ addSpecialization(area, areas, sourceDim);
+ /*
+ * At this point we are usually done for the current SubArea. But
if the given MathTransform
+ * is another SpecializableTransform, then instead of storing
nested SpecializableTransforms
+ * we will store directly the specializations that it contains.
This will reduce the amount
+ * of steps when transforming coordinates.
+ */
+ if (inherited != null) {
+ for (final SubArea other : inherited) {
+ final SubArea e = new SubArea(other, other.transform);
+ e.intersect(area);
+ addSpecialization(e, areas, sourceDim);
}
}
- areas[n++] = area;
}
- domains = ArraysExt.resize(areas, n);
+ domains = areas.toArray(new SubArea[areas.size()]);
SubArea.uniformize(domains);
}
@@ -301,6 +304,35 @@ next: for (final Map.Entry<Envelope,Ma
}
}
+ /**
+ * Verifies if the given {@code area} has the expected number of
dimensions,
+ * then adds it to {@code domains} list (eventually as a child of an
existing node).
+ *
+ * @param area the new sub-area to add.
+ * @param domains where to add the sub-area (not necessarily directly;
maybe as a child of an existing node).
+ * @param dim expected number of dimensions, for verification
purpose.
+ */
+ private static void addSpecialization(final SubArea area, final
List<SubArea> domains, final int dim) {
+ if (!area.isEmpty()) {
+ if (area.getDimension() != dim) {
+ throw new
MismatchedDimensionException(Errors.format(Errors.Keys.MismatchedDimension_3,
+ "envelope", dim, area.getDimension()));
+ }
+ for (final SubArea previous : domains) {
+ if (previous.addSpecialization(area)) {
+ return;
+ }
+ }
+ for (final SubArea previous : domains) {
+ if (area.intersects(previous)) {
+ // Pending implementation of R-Tree in Apache SIS.
+ throw new IllegalArgumentException("Current implementation
does not accept overlapping envelopes.");
+ }
+ }
+ domains.add(area);
+ }
+ }
+
/**
* Gets the dimension of input points.
*/
Modified:
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/ObjectToString.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/ObjectToString.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/ObjectToString.java
[UTF-8] (original)
+++
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/ObjectToString.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -38,7 +38,7 @@ import org.apache.sis.math.FunctionPrope
* This base class and all inner classes are immutable, and thus inherently
thread-safe.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 1.0
*
* @param <S> the source type.
*
@@ -91,11 +91,20 @@ class ObjectToString<S> extends SystemCo
/**
* Returns the singleton instance on deserialization, if any.
+ *
+ * @see StringConverter#unique()
*/
@Override
public final ObjectConverter<S, String> unique() {
+ /*
+ * The checks against null references are needed because on
deserialization,
+ * the inverse of this inverse converter may not be assigned a value
yet.
+ */
if (inverse != null) {
- return inverse.unique().inverse(); // Will typically
delegate to StringConverter.
+ ObjectConverter<S, String> singleton = inverse.unique().inverse();
// Will typically delegate to StringConverter.
+ if (singleton != null) {
+ return singleton;
+ }
}
return this;
}
Modified:
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java
[UTF-8] (original)
+++
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -33,7 +33,7 @@ import org.apache.sis.util.resources.Err
* and thread-safe too if they are intended to be cached in {@link
ConverterRegistry}.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 1.0
*
* @param <S> the base type of source objects.
* @param <T> the base type of converted objects.
@@ -141,10 +141,23 @@ abstract class SystemConverter<S,T> exte
* Otherwise this converter is returned <strong>without</strong> being
cached.
*
* @return the unique instance, or {@code this} if no unique instance can
be found.
+ *
+ * @see ObjectToString#unique()
*/
public ObjectConverter<S,T> unique() {
- final ObjectConverter<S,T> existing =
SystemRegistry.INSTANCE.findEquals(this);
- return (existing != null) ? existing : this;
+ /*
+ * On deserialization, some fields are not yet assigned a value at the
moment of this call.
+ * This happen when this unique() method is invoked by
inverse().readResolve() — not by the
+ * readResolve() method of this class — in which case the
deserialization process is not yet
+ * fully completed. In such cases, we can not determine if an existing
instance is available.
+ * We return the current instance as a fallback, leaving to
inverse().readResolve() the task
+ * of returning a unique instance after it finished its own
deserialization process.
+ */
+ if (sourceClass != null && targetClass != null) {
+ final ObjectConverter<S,T> existing =
SystemRegistry.INSTANCE.findEquals(this);
+ if (existing != null) return existing;
+ }
+ return this;
}
/**
Modified:
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/package-info.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/package-info.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/package-info.java
[UTF-8] (original)
+++
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/converter/package-info.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -42,7 +42,7 @@
* classpath changes.</p>
*
* @author Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
* @since 0.3
* @module
*/
Modified:
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
[UTF-8] (original)
+++ sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -194,7 +194,7 @@ public final class Classes extends Stati
}
/**
- * Delegates to {@link ParameterizedType#getActualTypeArguments} and
returns the result as a
+ * Delegates to {@link ParameterizedType#getActualTypeArguments()} and
returns the result as a
* {@link Class}, provided that every objects are of the expected classes
and the result was
* an array of length 1 (so there is no ambiguity). Otherwise returns
{@code null}.
*/
@@ -714,7 +714,7 @@ cmp: for (final Class<?> c : c1) {
*/
public static boolean isPossibleGetter(final Method method) {
return method.getReturnType() != Void.TYPE &&
- method.getParameterTypes().length == 0 &&
+ method.getParameterCount() == 0 &&
!method.isSynthetic() &&
!ArraysExt.contains(EXCLUDES, method.getName());
}
Modified:
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListener.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListener.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListener.java
[UTF-8] (original)
+++
sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListener.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -42,6 +42,7 @@ import java.util.logging.LogRecord;
*
* @see WarningListeners
* @see org.apache.sis.storage.DataStore#addWarningListener(WarningListener)
+ * @see org.apache.sis.storage.event.ChangeListener
*
* @since 0.3
* @module
Modified:
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
[UTF-8] (original)
+++
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -25,7 +25,7 @@ import org.junit.BeforeClass;
* All tests from the {@code sis-utility} module, in approximative dependency
order.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
* @since 0.3
* @module
*/
Modified:
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java
URL:
http://svn.apache.org/viewvc/sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
---
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java
[UTF-8] (original)
+++
sis/trunk/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -40,7 +40,7 @@ import static org.apache.sis.test.Assert
*
* @author Martin Desruisseaux (Geomatys)
* @author Alexis Manin (Geomatys)
- * @version 0.8
+ * @version 1.0
* @since 0.7
* @module
*/
@@ -291,6 +291,6 @@ public final strictfp class IntegerListT
final Random random = TestUtilities.createRandomNumberGenerator();
return IntStream.generate(() -> random.nextInt(maxValue))
.limit(size)
- .collect(() -> new IntegerList(size, maxValue),
IntegerList::addInt, null);
+ .collect(() -> new IntegerList(size, maxValue),
IntegerList::addInt, (l1, l2) -> l1.addAll(l2));
}
}
Modified: sis/trunk/ide-project/NetBeans/build.xml
URL:
http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/build.xml?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/build.xml (original)
+++ sis/trunk/ide-project/NetBeans/build.xml Sat Mar 31 12:14:13 2018
@@ -53,6 +53,11 @@
<fileset
dir="${project.root}/core/sis-raster/target/generated-resources">
<include name="**/*.utf"/>
</fileset>
+ <!-- Not yet available.
+ <fileset
dir="${project.root}/core/sis-portrayal/target/generated-resources">
+ <include name="**/*.utf"/>
+ </fileset>
+ -->
<fileset
dir="${project.root}/storage/sis-storage/target/generated-resources">
<include name="**/*.utf"/>
</fileset>