Modified: 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java?rev=1778656&r1=1778655&r2=1778656&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
 [UTF-8] Fri Jan 13 18:58:25 2017
@@ -58,7 +58,7 @@ import static org.apache.sis.test.TestUt
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  */
 @DependsOn({
@@ -69,36 +69,55 @@ import static org.apache.sis.test.TestUt
     ValueMapTest.class})
 public final strictfp class MetadataStandardTest extends TestCase {
     /**
+     * The standard being tested.
+     */
+    private MetadataStandard standard;
+
+    /**
+     * Returns {@code true} if the given type is a metadata.
+     */
+    private boolean isMetadata(final Class<?> type) {
+        return standard.isMetadata(type);
+    }
+
+    /**
      * Tests {@link MetadataStandard#isMetadata(Class)}.
      */
     @Test
     public void testIsMetadata() {
-        MetadataStandard std = MetadataStandard.ISO_19115;
-        assertFalse("isMetadata(String)",                 
std.isMetadata(String.class));
-        assertTrue ("isMetadata(Citation)",               
std.isMetadata(Citation.class));
-        assertTrue ("isMetadata(DefaultCitation)",        
std.isMetadata(DefaultCitation.class));
-        assertFalse("isMetadata(IdentifiedObject)",       
std.isMetadata(IdentifiedObject.class));
-        assertFalse("isMetadata(SimpleIdentifiedObject)", 
std.isMetadata(SimpleIdentifiedObject.class));
-        assertFalse("isMetadata(GeographicCRS)",          
std.isMetadata(GeographicCRS.class));
-        assertFalse("isMetadata(RectifiedGrid)",          
std.isMetadata(RectifiedGrid.class));
-
-        std = MetadataStandard.ISO_19111;
-        assertFalse("isMetadata(String)",                 
std.isMetadata(String.class));
-        assertTrue ("isMetadata(Citation)",               
std.isMetadata(Citation.class));          // Dependency
-        assertTrue ("isMetadata(DefaultCitation)",        
std.isMetadata(DefaultCitation.class));   // Dependency
-        assertTrue ("isMetadata(IdentifiedObject)",       
std.isMetadata(IdentifiedObject.class));
-        assertTrue ("isMetadata(SimpleIdentifiedObject)", 
std.isMetadata(SimpleIdentifiedObject.class));
-        assertTrue ("isMetadata(GeographicCRS)",          
std.isMetadata(GeographicCRS.class));
-        assertFalse("isMetadata(RectifiedGrid)",          
std.isMetadata(RectifiedGrid.class));
-
-        std = MetadataStandard.ISO_19123;
-        assertFalse("isMetadata(String)",                 
std.isMetadata(String.class));
-        assertTrue ("isMetadata(Citation)",               
std.isMetadata(Citation.class));               // Transitive dependency
-        assertTrue ("isMetadata(DefaultCitation)",        
std.isMetadata(DefaultCitation.class));        // Transivive dependency
-        assertTrue ("isMetadata(IdentifiedObject)",       
std.isMetadata(IdentifiedObject.class));       // Dependency
-        assertTrue ("isMetadata(SimpleIdentifiedObject)", 
std.isMetadata(SimpleIdentifiedObject.class)); // Dependency
-        assertTrue ("isMetadata(GeographicCRS)",          
std.isMetadata(GeographicCRS.class));          // Dependency
-        assertTrue ("isMetadata(RectifiedGrid)",          
std.isMetadata(RectifiedGrid.class));
+        standard = MetadataStandard.ISO_19115;
+        assertFalse("isMetadata(String)",                 
isMetadata(String.class));
+        assertTrue ("isMetadata(Citation)",               
isMetadata(Citation.class));
+        assertTrue ("isMetadata(DefaultCitation)",        
isMetadata(DefaultCitation.class));
+        assertFalse("isMetadata(IdentifiedObject)",       
isMetadata(IdentifiedObject.class));
+        assertFalse("isMetadata(SimpleIdentifiedObject)", 
isMetadata(SimpleIdentifiedObject.class));
+        assertFalse("isMetadata(GeographicCRS)",          
isMetadata(GeographicCRS.class));
+        assertFalse("isMetadata(RectifiedGrid)",          
isMetadata(RectifiedGrid.class));
+
+        standard = MetadataStandard.ISO_19111;
+        assertFalse("isMetadata(String)",                 
isMetadata(String.class));
+        assertTrue ("isMetadata(Citation)",               
isMetadata(Citation.class));               // Dependency
+        assertTrue ("isMetadata(DefaultCitation)",        
isMetadata(DefaultCitation.class));        // Dependency
+        assertTrue ("isMetadata(IdentifiedObject)",       
isMetadata(IdentifiedObject.class));
+        assertTrue ("isMetadata(SimpleIdentifiedObject)", 
isMetadata(SimpleIdentifiedObject.class));
+        assertTrue ("isMetadata(GeographicCRS)",          
isMetadata(GeographicCRS.class));
+        assertFalse("isMetadata(RectifiedGrid)",          
isMetadata(RectifiedGrid.class));
+
+        standard = MetadataStandard.ISO_19123;
+        assertFalse("isMetadata(String)",                 
isMetadata(String.class));
+        assertTrue ("isMetadata(Citation)",               
isMetadata(Citation.class));               // Transitive dependency
+        assertTrue ("isMetadata(DefaultCitation)",        
isMetadata(DefaultCitation.class));        // Transivive dependency
+        assertTrue ("isMetadata(IdentifiedObject)",       
isMetadata(IdentifiedObject.class));       // Dependency
+        assertTrue ("isMetadata(SimpleIdentifiedObject)", 
isMetadata(SimpleIdentifiedObject.class)); // Dependency
+        assertTrue ("isMetadata(GeographicCRS)",          
isMetadata(GeographicCRS.class));          // Dependency
+        assertTrue ("isMetadata(RectifiedGrid)",          
isMetadata(RectifiedGrid.class));
+    }
+
+    /**
+     * Returns the interface for the given metadata implementation class.
+     */
+    private Class<?> getInterface(final Class<?> type) {
+        return standard.getInterface(type);
     }
 
     /**
@@ -107,38 +126,46 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testIsMetadata")
     public void testGetInterface() {
-        MetadataStandard std = MetadataStandard.ISO_19115;
-        assertEquals("getInterface(Citation)",             Citation.class,     
std.getInterface(Citation.class));
-        assertEquals("getInterface(DefaultCitation)",      Citation.class,     
std.getInterface(DefaultCitation.class));
-        assertEquals("getInterface(AbstractCompleteness)", Completeness.class, 
std.getInterface(AbstractCompleteness.class));
-
-        std = MetadataStandard.ISO_19111;
-        assertEquals("getInterface(Citation)",               Citation.class,   
      std.getInterface(Citation.class));
-        assertEquals("getInterface(DefaultCitation)",        Citation.class,   
      std.getInterface(DefaultCitation.class));
-        assertEquals("getInterface(AbstractCompleteness)",   
Completeness.class,     std.getInterface(AbstractCompleteness.class));
-        assertEquals("getInterface(IdentifiedObject)",       
IdentifiedObject.class, std.getInterface(IdentifiedObject.class));
-        assertEquals("getInterface(SimpleIdentifiedObject)", 
IdentifiedObject.class, std.getInterface(SimpleIdentifiedObject.class));
-        assertEquals("getInterface(GeographicCRS)",          
GeographicCRS.class,    std.getInterface(GeographicCRS.class));
+        standard = MetadataStandard.ISO_19115;
+        assertEquals("getInterface(Citation)",               Citation.class,   
      getInterface(Citation.class));
+        assertEquals("getInterface(DefaultCitation)",        Citation.class,   
      getInterface(DefaultCitation.class));
+        assertEquals("getInterface(AbstractCompleteness)",   
Completeness.class,     getInterface(AbstractCompleteness.class));
+
+        standard = MetadataStandard.ISO_19111;
+        assertEquals("getInterface(Citation)",               Citation.class,   
      getInterface(Citation.class));
+        assertEquals("getInterface(DefaultCitation)",        Citation.class,   
      getInterface(DefaultCitation.class));
+        assertEquals("getInterface(AbstractCompleteness)",   
Completeness.class,     getInterface(AbstractCompleteness.class));
+        assertEquals("getInterface(IdentifiedObject)",       
IdentifiedObject.class, getInterface(IdentifiedObject.class));
+        assertEquals("getInterface(SimpleIdentifiedObject)", 
IdentifiedObject.class, getInterface(SimpleIdentifiedObject.class));
+        assertEquals("getInterface(GeographicCRS)",          
GeographicCRS.class,    getInterface(GeographicCRS.class));
 
         // Verify that the cache has not been updated in inconsistent way.
         testIsMetadata();
     }
 
     /**
+     * Returns the interface type declared by the accessor for the given class.
+     */
+    private Class<?> getAccessor(final Class<?> type, final boolean mandatory) 
{
+        final PropertyAccessor accessor = standard.getAccessor(new 
CacheKey(type), mandatory);
+        return (accessor != null) ? accessor.type : null;
+    }
+
+    /**
      * Tests {@link MetadataStandard#getAccessor(Class, boolean)}.
      */
     @Test
     @DependsOnMethod("testGetInterface")
     public void testGetAccessor() {
-        MetadataStandard std = MetadataStandard.ISO_19115;
-        assertEquals("getAccessor(DefaultCitation)",      Citation.class,     
std.getAccessor(DefaultCitation.class, true).type);
-        assertEquals("getAccessor(AbstractCompleteness)", Completeness.class, 
std.getAccessor(AbstractCompleteness.class, true).type);
-        assertNull  ("getAccessor(SimpleIdentifiedObject)",                   
std.getAccessor(SimpleIdentifiedObject.class, false));
-
-        std = MetadataStandard.ISO_19111;
-        assertEquals("getAccessor(DefaultCitation)",        Citation.class,    
     std.getAccessor(DefaultCitation.class, true).type);
-        assertEquals("getAccessor(AbstractCompleteness)",   
Completeness.class,     std.getAccessor(AbstractCompleteness.class, true).type);
-        assertEquals("getAccessor(SimpleIdentifiedObject)", 
IdentifiedObject.class, std.getAccessor(SimpleIdentifiedObject.class, 
true).type);
+        standard = MetadataStandard.ISO_19115;
+        assertEquals("getAccessor(DefaultCitation)",        Citation.class,    
     getAccessor(DefaultCitation.class, true));
+        assertEquals("getAccessor(AbstractCompleteness)",   
Completeness.class,     getAccessor(AbstractCompleteness.class, true));
+        assertNull  ("getAccessor(SimpleIdentifiedObject)",                    
     getAccessor(SimpleIdentifiedObject.class, false));
+
+        standard = MetadataStandard.ISO_19111;
+        assertEquals("getAccessor(DefaultCitation)",        Citation.class,    
     getAccessor(DefaultCitation.class, true));
+        assertEquals("getAccessor(AbstractCompleteness)",   
Completeness.class,     getAccessor(AbstractCompleteness.class, true));
+        assertEquals("getAccessor(SimpleIdentifiedObject)", 
IdentifiedObject.class, getAccessor(SimpleIdentifiedObject.class, true));
 
         // Verify that the cache has not been updated in inconsistent way.
         testGetInterface();
@@ -151,9 +178,9 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testGetInterface")
     public void testGetWrongInterface() {
-        final MetadataStandard std = new MetadataStandard("SIS", 
"org.apache.sis.dummy.", null);
+        standard = new MetadataStandard("SIS", "org.apache.sis.dummy.", null);
         try {
-            std.getInterface(DefaultCitation.class);
+            getInterface(DefaultCitation.class);
             fail("No dummy interface expected.");
         } catch (ClassCastException e) {
             // This is the expected exception.
@@ -167,21 +194,21 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testGetAccessor")
     public void testEquals() {
-        final MetadataStandard std = MetadataStandard.ISO_19115;
+        standard = MetadataStandard.ISO_19115;
 
         // Self equality test
         DefaultCitation instance = HardCodedCitations.EPSG;
-        assertFalse(std.equals(instance, HardCodedCitations.SIS,  
ComparisonMode.STRICT));
-        assertTrue (std.equals(instance, HardCodedCitations.EPSG, 
ComparisonMode.STRICT));
+        assertFalse(standard.equals(instance, HardCodedCitations.SIS,  
ComparisonMode.STRICT));
+        assertTrue (standard.equals(instance, HardCodedCitations.EPSG, 
ComparisonMode.STRICT));
 
         // Test comparison with a copy
         instance = new DefaultCitation(HardCodedCitations.EPSG);
-        assertFalse(std.equals(instance, HardCodedCitations.SIS,  
ComparisonMode.STRICT));
-        assertTrue (std.equals(instance, HardCodedCitations.EPSG, 
ComparisonMode.STRICT));
+        assertFalse(standard.equals(instance, HardCodedCitations.SIS,  
ComparisonMode.STRICT));
+        assertTrue (standard.equals(instance, HardCodedCitations.EPSG, 
ComparisonMode.STRICT));
 
         // test comparison with a modified copy
         instance.setTitle(new SimpleInternationalString("A dummy title"));
-        assertFalse(std.equals(instance, HardCodedCitations.EPSG,    
ComparisonMode.STRICT));
+        assertFalse(standard.equals(instance, HardCodedCitations.EPSG, 
ComparisonMode.STRICT));
     }
 
     /**
@@ -223,7 +250,7 @@ public final strictfp class MetadataStan
     @DependsOnMethod("testGetAccessor")
     public void testValueMap() {
         final DefaultCitation instance = new 
DefaultCitation(HardCodedCitations.EPSG);
-        final Map<String,Object> map = 
MetadataStandard.ISO_19115.asValueMap(instance,
+        final Map<String,Object> map = 
MetadataStandard.ISO_19115.asValueMap(instance, null,
                 KeyNamePolicy.JAVABEANS_PROPERTY, 
ValueExistencePolicy.NON_EMPTY);
         assertFalse("The properties map shall not be empty.", map.isEmpty());
         assertEquals("Unexpected number of properties.", 4, map.size());
@@ -261,13 +288,13 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testValueMap")
     public void testHashCode() {
-        final MetadataStandard std = MetadataStandard.ISO_19115;
+        standard = MetadataStandard.ISO_19115;
         final DefaultCitation instance = HardCodedCitations.EPSG;
-        final Map<String,Object> map = std.asValueMap(instance,
+        final Map<String,Object> map = standard.asValueMap(instance, null,
                 KeyNamePolicy.JAVABEANS_PROPERTY, 
ValueExistencePolicy.NON_EMPTY);
         assertFalse(map.isEmpty()); // Actually 'testValueMap()' job, but 
verified for safety.
         assertEquals("hashCode()", new HashSet<>(map.values()).hashCode() + 
Citation.class.hashCode(),
-                std.hashCode(instance));
+                standard.hashCode(instance));
     }
 
     /**
@@ -279,13 +306,13 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testHashCode")
     public void testHashCodeOnCyclicMetadata() {
-        final MetadataStandard std = MetadataStandard.ISO_19115;
-        final int code = std.hashCode(createCyclicMetadata());
+        standard = MetadataStandard.ISO_19115;
+        final int code = standard.hashCode(createCyclicMetadata());
         /*
          * Following line checks that the hash code is stable, just for doing 
something with the code.
          * The real test was actually to ensure that the above line didn't 
threw a StackOverflowError.
          */
-        assertEquals(code, std.hashCode(createCyclicMetadata()));
+        assertEquals(code, standard.hashCode(createCyclicMetadata()));
     }
 
     /**
@@ -295,15 +322,15 @@ public final strictfp class MetadataStan
     @Test
     @DependsOnMethod("testGetAccessor")
     public void testWithoutImplementation() {
-        final MetadataStandard std = MetadataStandard.ISO_19123;
-        assertFalse("isMetadata(String)",          
std.isMetadata(String.class));
-        assertTrue ("isMetadata(Citation)",        
std.isMetadata(Citation.class));         // Transitive dependency
-        assertTrue ("isMetadata(DefaultCitation)", 
std.isMetadata(DefaultCitation.class));  // Transitive dependency
-        assertTrue ("isMetadata(RectifiedGrid)",   
std.isMetadata(RectifiedGrid.class));
+        standard = MetadataStandard.ISO_19123;
+        assertFalse("isMetadata(String)",          isMetadata(String.class));
+        assertTrue ("isMetadata(Citation)",        
isMetadata(Citation.class));         // Transitive dependency
+        assertTrue ("isMetadata(DefaultCitation)", 
isMetadata(DefaultCitation.class));  // Transitive dependency
+        assertTrue ("isMetadata(RectifiedGrid)",   
isMetadata(RectifiedGrid.class));
         /*
          * Ensure that the getters have been found.
          */
-        final Map<String,String> names = std.asNameMap(RectifiedGrid.class, 
KeyNamePolicy.UML_IDENTIFIER, KeyNamePolicy.JAVABEANS_PROPERTY);
+        final Map<String,String> names = 
standard.asNameMap(RectifiedGrid.class, KeyNamePolicy.UML_IDENTIFIER, 
KeyNamePolicy.JAVABEANS_PROPERTY);
         assertFalse("Getters should have been found even if there is no 
implementation.", names.isEmpty());
         assertEquals("dimension", names.get("dimension"));
         assertEquals("cells", names.get("cell"));
@@ -312,11 +339,11 @@ public final strictfp class MetadataStan
          * which is of type List<double[]>.
          */
         Map<String,Class<?>> types;
-        types = std.asTypeMap(RectifiedGrid.class, 
KeyNamePolicy.UML_IDENTIFIER, TypeValuePolicy.PROPERTY_TYPE);
+        types = standard.asTypeMap(RectifiedGrid.class, 
KeyNamePolicy.UML_IDENTIFIER, TypeValuePolicy.PROPERTY_TYPE);
         assertEquals("The return type is the int primitive type.", 
Integer.TYPE, types.get("dimension"));
         assertEquals("The offset vectors are stored in a List.",   List.class, 
  types.get("offsetVectors"));
 
-        types = std.asTypeMap(RectifiedGrid.class, 
KeyNamePolicy.UML_IDENTIFIER, TypeValuePolicy.ELEMENT_TYPE);
+        types = standard.asTypeMap(RectifiedGrid.class, 
KeyNamePolicy.UML_IDENTIFIER, TypeValuePolicy.ELEMENT_TYPE);
         assertEquals("As elements in a list of dimensions.",       
Integer.class,  types.get("dimension"));
         assertEquals("As elements in the list of offset vectors.", 
double[].class, types.get("offsetVectors"));
     }

Modified: 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java?rev=1778656&r1=1778655&r2=1778656&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
 [UTF-8] Fri Jan 13 18:58:25 2017
@@ -64,8 +64,8 @@ public abstract strictfp class MetadataT
     /**
      * Creates a new test suite for the given types.
      *
-     * @param standard The standard implemented by the metadata objects to 
test.
-     * @param types The GeoAPI interfaces, {@link CodeList} or {@link Enum} 
types to test.
+     * @param  standard  the standard implemented by the metadata objects to 
test.
+     * @param  types     the GeoAPI interfaces, {@link CodeList} or {@link 
Enum} types to test.
      */
     protected MetadataTestCase(final MetadataStandard standard, final 
Class<?>... types) {
         super(types);
@@ -92,8 +92,8 @@ public abstract strictfp class MetadataT
      *
      * <p>The default implementation returns {@code true}.</p>
      *
-     * @param  impl     The implementation class.
-     * @param  property The name of the property to test.
+     * @param  impl      the implementation class.
+     * @param  property  the name of the property to test.
      * @return {@code true} if the given property is writable.
      */
     protected boolean isWritable(final Class<?> impl, final String property) {
@@ -108,9 +108,9 @@ public abstract strictfp class MetadataT
      * <p>The returned value may be of an other type than the given one if the
      * {@code PropertyAccessor} converter method know how to convert that 
type.</p>
      *
-     * @param  property The name of the property for which to create a value.
-     * @param  type The type of value to create.
-     * @return The value of the given {@code type}, or of a type convertible 
to the given type.
+     * @param  property  the name of the property for which to create a value.
+     * @param  type      the type of value to create.
+     * @return the value of the given {@code type}, or of a type convertible 
to the given type.
      */
     protected Object valueFor(final String property, final Class<?> type) {
         if (CharSequence.class.isAssignableFrom(type)) {
@@ -171,7 +171,7 @@ public abstract strictfp class MetadataT
      * Validates the given newly constructed metadata. The default 
implementation ensures that
      * {@link AbstractMetadata#isEmpty()} returns {@code true}.
      *
-     * @param metadata The metadata to validate.
+     * @param  metadata  the metadata to validate.
      */
     protected void validate(final AbstractMetadata metadata) {
         assertTrue("AbstractMetadata.isEmpty()", metadata.isEmpty());
@@ -179,7 +179,7 @@ public abstract strictfp class MetadataT
 
     /**
      * For every properties in every non-{@code Codelist} types listed in the 
{@link #types} array,
-     * test the property values. This method performs the tests documented in 
class javadoc.
+     * tests the property values. This method performs the tests documented in 
class javadoc.
      */
     @Test
     public void testPropertyValues() {

Modified: 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java?rev=1778656&r1=1778655&r2=1778656&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyAccessorTest.java
 [UTF-8] Fri Jan 13 18:58:25 2017
@@ -111,8 +111,8 @@ public final strictfp class PropertyAcce
      *
      * The tuples shall be ordered according the {@link PropertyComparator}.
      *
-     * @param accessor The accessor to test.
-     * @param expected The expected names and types as described above.
+     * @param  accessor  the accessor to test.
+     * @param  expected  the expected names and types as described above.
      *
      * @see PropertyAccessor#mapping
      */
@@ -229,9 +229,8 @@ public final strictfp class PropertyAcce
     }
 
     /**
-     * Tests the constructor with a method which override an other method with 
covariant
-     * return type. This test may need to be updated if a future GeoAPI 
release modifies
-     * the {@link GeographicCRS} interface.
+     * Tests the constructor with a method which override an other method with 
covariant return type.
+     * This test may need to be updated if a future GeoAPI release modifies 
the {@link GeographicCRS} interface.
      *
      * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-205";>GEOTK-205</a>
      */
@@ -264,8 +263,8 @@ public final strictfp class PropertyAcce
     }
 
     /**
-     * Tests the {@link PropertyAccessor#get(int, Object)} method on the 
{@link HardCodedCitations#ISO}
-     * constant. The metadata object read by this test is:
+     * Tests the {@link PropertyAccessor#get(int, Object)} method on the 
{@link HardCodedCitations#ISO} constant.
+     * The metadata object read by this test is:
      *
      * {@preformat text
      *   DefaultCitation
@@ -654,7 +653,7 @@ public final strictfp class PropertyAcce
      * Returns the code of the singleton identifier found in the given 
collection.
      * This method verifies that the object is of the expected type.
      *
-     * @param identifiers A singleton {@code Collection<Identifier>}.
+     * @param  identifiers  a singleton {@code Collection<Identifier>}.
      * @return {@link Identifier#getCode()}.
      */
     static String getSingletonCode(final Object identifiers) {

Modified: 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java?rev=1778656&r1=1778655&r2=1778656&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyInformationTest.java
 [UTF-8] Fri Jan 13 18:58:25 2017
@@ -50,10 +50,10 @@ public final strictfp class PropertyInfo
     /**
      * Creates a property information instance for the given method of the 
{@link Citation} interface.
      *
-     * @param  elementType The type of elements returned by the given method.
-     * @param  method      The name of the method.
-     * @param  property    The ISO 19115 name of the property.
-     * @throws NoSuchMethodException If the {@code method} name is invalid.
+     * @param  elementType  the type of elements returned by the given method.
+     * @param  method       the name of the method.
+     * @param  property     the ISO 19115 name of the property.
+     * @throws NoSuchMethodException if the {@code method} name is invalid.
      */
     private static <T> PropertyInformation<T> create(final Class<T> 
elementType, final String method,
             final String property) throws NoSuchMethodException
@@ -76,7 +76,7 @@ public final strictfp class PropertyInfo
      * Tests the properties of {@link Citation#getTitle()}.
      * The element type is an {@link InternationalString} singleton, which is 
mandatory.
      *
-     * @throws NoSuchMethodException Should never happen.
+     * @throws NoSuchMethodException if the {@code getTitle()} method has not 
been found.
      */
     @Test
     public void testTitle() throws NoSuchMethodException {
@@ -106,7 +106,7 @@ public final strictfp class PropertyInfo
      * Tests the properties of {@link Citation#getPresentationForms()}.
      * The element type is {@link PresentationForm} in a collection.
      *
-     * @throws NoSuchMethodException Should never happen.
+     * @throws NoSuchMethodException if the {@code getPresentationForms()} 
method has not been found.
      */
     @Test
     public void testPresentationForm() throws NoSuchMethodException {
@@ -135,7 +135,7 @@ public final strictfp class PropertyInfo
     /**
      * Tests {@link PropertyInformation#getDomainValue()} with a non-null 
range.
      *
-     * @throws NoSuchMethodException Should never happen.
+     * @throws NoSuchMethodException if the {@code getMaxRelativeHumidity()} 
or other method has not been found.
      */
     @Test
     @SuppressWarnings("UnnecessaryBoxing")
@@ -158,7 +158,7 @@ public final strictfp class PropertyInfo
      * Tests the {@link PropertyInformation#toString()} method.
      * All information in the expected strings have been validated by previous 
tests in this class.
      *
-     * @throws NoSuchMethodException Should never happen.
+     * @throws NoSuchMethodException if the {@code getTitle()} or other method 
has not been found.
      */
     @Test
     @DependsOnMethod({"testTitle", "testPresentationForm"})
@@ -173,7 +173,7 @@ public final strictfp class PropertyInfo
     /**
      * Tests serialization.
      *
-     * @throws NoSuchMethodException Should never happen.
+     * @throws NoSuchMethodException if the {@code getTitle()} method has not 
been found.
      */
     @Test
     public void testSerialization() throws NoSuchMethodException {

Modified: 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java?rev=1778656&r1=1778655&r2=1778656&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeChildrenTest.java
 [UTF-8] Fri Jan 13 18:58:25 2017
@@ -20,6 +20,7 @@ import java.util.Random;
 import java.util.Iterator;
 import java.util.List;
 import java.util.ArrayList;
+import org.opengis.metadata.Metadata;
 import org.opengis.metadata.citation.PresentationForm;
 import org.apache.sis.metadata.iso.citation.DefaultCitation;
 import org.apache.sis.util.iso.SimpleInternationalString;
@@ -48,7 +49,7 @@ import static org.apache.sis.test.TestUt
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.8
  * @module
  */
 @DependsOn(PropertyAccessorTest.class)
@@ -117,9 +118,9 @@ public final strictfp class TreeNodeChil
      */
     private static TreeNodeChildren create(final AbstractMetadata metadata, 
final ValueExistencePolicy valuePolicy) {
         final MetadataStandard standard = MetadataStandard.ISO_19115;
-        final TreeTableView    table    = new TreeTableView(standard, 
metadata, valuePolicy);
+        final TreeTableView    table    = new TreeTableView(standard, 
metadata, Metadata.class, valuePolicy);
         final TreeNode         node     = (TreeNode) table.getRoot();
-        final PropertyAccessor accessor = 
standard.getAccessor(metadata.getClass(), true);
+        final PropertyAccessor accessor = standard.getAccessor(new 
CacheKey(metadata.getClass()), true);
         return new TreeNodeChildren(node, metadata, accessor);
     }
 
@@ -199,9 +200,9 @@ public final strictfp class TreeNodeChil
             "Some title",
             "First alternate title",
             "Second alternate title",
-            "Third alternate title",  // After addition
-            "New edition", // After "addition" (actually change).
-            "PresentationForm[IMAGE_DIGITAL]", // After addition
+            "Third alternate title",                // After addition
+            "New edition",                          // After "addition" 
(actually change).
+            "PresentationForm[IMAGE_DIGITAL]",      // After addition
             "PresentationForm[MAP_DIGITAL]",
             "PresentationForm[MAP_HARDCOPY]",
             "Some other details"
@@ -216,7 +217,7 @@ public final strictfp class TreeNodeChil
         } catch (IllegalStateException e) {
             assertTrue(e.getMessage().contains("edition"));
         }
-        citation.setEdition(null); // Clears so we are allowed to add.
+        citation.setEdition(null);                                             
     // Clears so we are allowed to add.
         assertTrue("Setting a new value shall be a change.", 
children.add(toAdd));
 
         toAdd.setValue(TableColumn.IDENTIFIER, "presentationForm");
@@ -309,7 +310,7 @@ public final strictfp class TreeNodeChil
             "PresentationForm[MAP_HARDCOPY]",
             null, // series
             "Some other details",
-//          null, // collective title  -- deprecated as of ISO 19115:2014.
+//          null, // collective title                       -- deprecated as 
of ISO 19115:2014.
             null, // ISBN
             null, // ISSN
             null, // onlineResources (collection)
@@ -351,8 +352,8 @@ public final strictfp class TreeNodeChil
      * Asserts that all next elements traversed by the {@code actual} iterator 
are equal
      * to the next elements traversed by {@code expected}.
      *
-     * @param expected The iterator over expected values.
-     * @param actual   The iterator over actual values.
+     * @param  expected  the iterator over expected values.
+     * @param  actual    the iterator over actual values.
      */
     private static void assertAllNextEqual(final Iterator<?> expected, final 
Iterator<?> actual) {
         while (expected.hasNext()) {
@@ -367,19 +368,19 @@ public final strictfp class TreeNodeChil
      * Elements are removed randomly until the collection is empty. After each 
removal,
      * the remaining elements are compared with the content of a standard Java 
collection.
      *
-     * @param random   A random number generator.
-     * @param children The collection from which to remove elements.
+     * @param  random    a random number generator.
+     * @param  children  the collection from which to remove elements.
      */
     private static void testRemove(final Random random, final TreeNodeChildren 
children) {
         final List<TreeTable.Node> reference = new ArrayList<>(children);
         assertFalse("The collection shall not be initially empty.", 
reference.isEmpty());
         do {
-            final Iterator<TreeTable.Node> rit = reference.iterator(); // The 
reference iterator.
-            final Iterator<TreeTable.Node> cit = children .iterator(); // The 
children iterator to be tested.
+            final Iterator<TreeTable.Node> rit = reference.iterator();      // 
The reference iterator.
+            final Iterator<TreeTable.Node> cit = children .iterator();      // 
The children iterator to be tested.
             while (rit.hasNext()) {
                 assertTrue(cit.hasNext());
                 assertSame(rit.next(), cit.next());
-                if (random.nextInt(3) == 0) { // Remove only 1/3 of entries on 
each pass.
+                if (random.nextInt(3) == 0) {                           // 
Remove only 1/3 of entries on each pass.
                     rit.remove();
                     cit.remove();
                     assertAllNextEqual(reference.iterator(), 
children.iterator());

Modified: 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java?rev=1778656&r1=1778655&r2=1778656&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
 [UTF-8] Fri Jan 13 18:58:25 2017
@@ -49,7 +49,7 @@ import static java.util.Collections.sing
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.8
  * @module
  */
 @DependsOn(TreeNodeChildrenTest.class)
@@ -100,9 +100,11 @@ public final strictfp class TreeNodeTest
     /**
      * Creates a node to be tested for the given metadata object and value 
policy.
      */
-    private static TreeNode create(final AbstractMetadata metadata, final 
ValueExistencePolicy valuePolicy) {
+    private static <T extends AbstractMetadata> TreeNode create(final T 
metadata,
+            final Class<? super T> baseType, final ValueExistencePolicy 
valuePolicy)
+    {
         final MetadataStandard  standard = MetadataStandard.ISO_19115;
-        final TreeTableView table = new TreeTableView(standard, metadata, 
valuePolicy);
+        final TreeTableView table = new TreeTableView(standard, metadata, 
baseType, valuePolicy);
         return (TreeNode) table.getRoot();
     }
 
@@ -112,10 +114,10 @@ public final strictfp class TreeNodeTest
     @Test
     public void testRootNode() {
         final DefaultCitation citation = 
TreeNodeChildrenTest.metadataWithoutCollections();
-        final TreeNode node = create(citation, ValueExistencePolicy.NON_EMPTY);
+        final TreeNode node = create(citation, Citation.class, 
ValueExistencePolicy.NON_EMPTY);
         assertEquals("getName()",        "Citation",     node.getName());
         assertEquals("getIdentifier()",  "CI_Citation",  node.getIdentifier());
-        assertEquals("getElementType()", Citation.class, 
node.getElementType());
+        assertEquals("baseType",         Citation.class, node.baseType);
         assertSame  ("getUserObject()",  citation,       node.getUserObject());
         assertFalse ("isWritable()",                     node.isWritable());
         assertNull  ("getParent()",                      node.getParent());
@@ -132,10 +134,10 @@ public final strictfp class TreeNodeTest
      * Those names shall <em>not</em> contain numbering like <cite>"(1 of 
2)"</cite>.
      */
     @Test
-    @DependsOnMethod("testRootNode") // Because tested more basic methods than 
'getValue(TableColumn)'.
+    @DependsOnMethod("testRootNode")            // Because tested more basic 
methods than 'getValue(TableColumn)'.
     public void testGetNameForSingleton() {
         final DefaultCitation citation = 
TreeNodeChildrenTest.metadataWithSingletonInCollections();
-        assertColumnContentEquals(create(citation, 
ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
+        assertColumnContentEquals(create(citation, Citation.class, 
ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
             "Citation",
               "Title",
               "Alternate title",
@@ -152,7 +154,7 @@ public final strictfp class TreeNodeTest
     @DependsOnMethod("testGetNameForSingleton")
     public void testGetNameForMultiOccurrences() {
         final DefaultCitation citation = 
TreeNodeChildrenTest.metadataWithMultiOccurrences();
-        assertColumnContentEquals(create(citation, 
ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
+        assertColumnContentEquals(create(citation, Citation.class, 
ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
             "Citation",
               "Title",
               "Alternate title (1 of 2)",
@@ -170,7 +172,7 @@ public final strictfp class TreeNodeTest
     @DependsOnMethod("testGetNameForMultiOccurrences")
     public void testGetNameForHierarchy() {
         final DefaultCitation citation = metadataWithHierarchy();
-        assertColumnContentEquals(create(citation, 
ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
+        assertColumnContentEquals(create(citation, Citation.class, 
ValueExistencePolicy.NON_EMPTY), TableColumn.NAME,
             "Citation",
               "Title",
               "Alternate title (1 of 2)",
@@ -199,10 +201,10 @@ public final strictfp class TreeNodeTest
      * The repetition of the same identifier means that they shall be part of 
a collection.
      */
     @Test
-    @DependsOnMethod("testGetNameForMultiOccurrences") // Because similar to 
names, which were tested progressively.
+    @DependsOnMethod("testGetNameForMultiOccurrences")     // Because similar 
to names, which were tested progressively.
     public void testGetIdentifier() {
         final DefaultCitation citation = metadataWithHierarchy();
-        assertColumnContentEquals(create(citation, 
ValueExistencePolicy.NON_EMPTY), TableColumn.IDENTIFIER,
+        assertColumnContentEquals(create(citation, Citation.class, 
ValueExistencePolicy.NON_EMPTY), TableColumn.IDENTIFIER,
             "CI_Citation",
               "title",
               "alternateTitle",
@@ -233,7 +235,7 @@ public final strictfp class TreeNodeTest
         final Integer ZERO = 0;
         final Integer ONE  = 1;
         final DefaultCitation citation = metadataWithHierarchy();
-        assertColumnContentEquals(create(citation, 
ValueExistencePolicy.NON_EMPTY), TableColumn.INDEX,
+        assertColumnContentEquals(create(citation, Citation.class, 
ValueExistencePolicy.NON_EMPTY), TableColumn.INDEX,
             null,           // CI_Citation
               null,         // title
               ZERO,         // alternateTitle
@@ -259,10 +261,10 @@ public final strictfp class TreeNodeTest
      * Tests {@link TreeNode#getElementType()} on a metadata with a hierarchy.
      */
     @Test
-    @DependsOnMethod("testGetIdentifier") // Because if identifiers are wrong, 
we are looking at wrong properties.
+    @DependsOnMethod("testGetIdentifier")       // Because if identifiers are 
wrong, we are looking at wrong properties.
     public void testGetElementType() {
         final DefaultCitation citation = metadataWithHierarchy();
-        assertColumnContentEquals(create(citation, 
ValueExistencePolicy.NON_EMPTY), TableColumn.TYPE,
+        assertColumnContentEquals(create(citation, Citation.class, 
ValueExistencePolicy.NON_EMPTY), TableColumn.TYPE,
             Citation.class,
               InternationalString.class,
               InternationalString.class,
@@ -288,10 +290,10 @@ public final strictfp class TreeNodeTest
      * Tests {@link TreeNode#getValue(TableColumn)} for the value column.
      */
     @Test
-    @DependsOnMethod("testGetIdentifier") // Because if identifiers are wrong, 
we are looking at wrong properties.
+    @DependsOnMethod("testGetIdentifier")       // Because if identifiers are 
wrong, we are looking at wrong properties.
     public void testGetValue() {
         final DefaultCitation citation = metadataWithHierarchy();
-        assertColumnContentEquals(create(citation, 
ValueExistencePolicy.NON_EMPTY), TableColumn.VALUE,
+        assertColumnContentEquals(create(citation, Citation.class, 
ValueExistencePolicy.NON_EMPTY), TableColumn.VALUE,
             null, // Citation
               "Some title",
               "First alternate title",
@@ -320,7 +322,7 @@ public final strictfp class TreeNodeTest
     @DependsOnMethod("testGetValue")
     public void testNewChild() {
         final DefaultCitation citation = metadataWithHierarchy();
-        final TreeNode node = create(citation, ValueExistencePolicy.NON_EMPTY);
+        final TreeNode node = create(citation, Citation.class, 
ValueExistencePolicy.NON_EMPTY);
         /*
          * Ensure that we can not overwrite existing nodes.
          */
@@ -357,11 +359,11 @@ public final strictfp class TreeNodeTest
      * on all children of that given. In the particular case of the {@link 
#NAME} method,
      * international strings are replaced by unlocalized strings before 
comparisons.
      *
-     * @param node     The node for which to test the children.
-     * @param column   The column from which to get a value.
-     * @param values   The expected values. The first value is the result of 
the getter method
-     *                 applied on the given node, and all other values are the 
result of the
-     *                 getter method applied on the children, in iteration 
order.
+     * @param  node     the node for which to test the children.
+     * @param  column   the column from which to get a value.
+     * @param  values   the expected values. The first value is the result of 
the getter method
+     *                  applied on the given node, and all other values are 
the result of the
+     *                  getter method applied on the children, in iteration 
order.
      */
     private static void assertColumnContentEquals(final TreeNode node,
             final TableColumn<?> column, final Object... values)

Modified: 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java?rev=1778656&r1=1778655&r2=1778656&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableViewTest.java
 [UTF-8] Fri Jan 13 18:58:25 2017
@@ -20,6 +20,7 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import org.opengis.metadata.citation.Citation;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -36,7 +37,7 @@ import static org.apache.sis.test.TestUt
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.8
  * @module
  */
 @DependsOn(TreeNodeTest.class)
@@ -45,7 +46,7 @@ public final strictfp class TreeTableVie
      * Creates a table to be tested for the given value policy.
      */
     private static TreeTableView create(final ValueExistencePolicy 
valuePolicy) {
-        return new TreeTableView(MetadataStandard.ISO_19115, 
TreeNodeTest.metadataWithHierarchy(), valuePolicy);
+        return new TreeTableView(MetadataStandard.ISO_19115, 
TreeNodeTest.metadataWithHierarchy(), Citation.class, valuePolicy);
     }
 
     /**

Modified: 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java?rev=1778656&r1=1778655&r2=1778656&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
 [UTF-8] Fri Jan 13 18:58:25 2017
@@ -86,7 +86,7 @@ public final strictfp class ValueMapTest
      * The citation instance is stored in the {@link #citation} field.
      * The title and author instances are stored in the {@link #title} and 
{@link #author} fields.
      *
-     * @return The map view of the citation create by this method.
+     * @return the map view of the citation create by this method.
      */
     private Map<String,Object> createCitation() {
         title    = new SimpleInternationalString("Undercurrent");
@@ -96,7 +96,7 @@ public final strictfp class ValueMapTest
         citation.setCitedResponsibleParties(singleton(author));
         citation.setISBN("9782505004509");
         
citation.setEdition(NilReason.UNKNOWN.createNilObject(InternationalString.class));
-        return MetadataStandard.ISO_19115.asValueMap(citation, 
KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_EMPTY);
+        return MetadataStandard.ISO_19115.asValueMap(citation, null, 
KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_EMPTY);
     }
 
     /**
@@ -157,7 +157,7 @@ public final strictfp class ValueMapTest
     public void testEntrySetForNonNil() {
         final Map<String,Object> map = createCitation();
         final Map<String,Object> all = 
MetadataStandard.ISO_19115.asValueMap(citation,
-                KeyNamePolicy.JAVABEANS_PROPERTY, 
ValueExistencePolicy.NON_NIL);
+                null, KeyNamePolicy.JAVABEANS_PROPERTY, 
ValueExistencePolicy.NON_NIL);
         assertFalse("Null values shall be excluded.", 
map.containsKey("alternateTitles"));
         assertTrue ("Null values shall be included.", 
all.containsKey("alternateTitles"));
         assertFalse("Nil objects shall be excluded.", 
map.containsKey("edition"));
@@ -187,7 +187,7 @@ public final strictfp class ValueMapTest
     public void testEntrySetForNonNull() {
         final Map<String,Object> map = createCitation();
         final Map<String,Object> all = 
MetadataStandard.ISO_19115.asValueMap(citation,
-                KeyNamePolicy.JAVABEANS_PROPERTY, 
ValueExistencePolicy.NON_NULL);
+                null, KeyNamePolicy.JAVABEANS_PROPERTY, 
ValueExistencePolicy.NON_NULL);
         assertFalse("Null values shall be excluded.", 
map.containsKey("alternateTitles"));
         assertTrue ("Null values shall be included.", 
all.containsKey("alternateTitles"));
         assertFalse("Nil objects shall be excluded.", 
map.containsKey("edition"));
@@ -218,7 +218,7 @@ public final strictfp class ValueMapTest
     public void testEntrySetForAll() {
         final Map<String,Object> map = createCitation();
         final Map<String,Object> all = 
MetadataStandard.ISO_19115.asValueMap(citation,
-                KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.ALL);
+                null, KeyNamePolicy.JAVABEANS_PROPERTY, 
ValueExistencePolicy.ALL);
         assertFalse("Null values shall be excluded.", 
map.containsKey("alternateTitles"));
         assertTrue ("Null values shall be included.", 
all.containsKey("alternateTitles"));
         assertTrue ("'all' shall be a larger map than 'map'.", 
all.entrySet().containsAll(map.entrySet()));

Modified: 
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Capability.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Capability.java?rev=1778656&r1=1778655&r2=1778656&view=diff
==============================================================================
--- 
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Capability.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Capability.java
 [UTF-8] Fri Jan 13 18:58:25 2017
@@ -21,8 +21,10 @@ import java.util.Collection;
 import org.apache.sis.storage.DataStores;
 import org.apache.sis.storage.DataStoreProvider;
 import org.apache.sis.util.resources.Vocabulary;
-import org.opengis.metadata.citation.Citation;
+
+// Branch-dependent imports
 import org.opengis.util.InternationalString;
+import org.opengis.metadata.citation.Citation;
 
 
 /**
@@ -95,10 +97,9 @@ public enum Capability {
              * Get a title for the format, followed by the short name between 
parenthesis
              * if it does not repeat the main title.
              */
-            final Citation spec = 
provider.getFormat().getFormatSpecificationCitation();
-            String title = title(spec, true).toString(locale);
-            final String abbreviation = title(spec, false).toString(locale);
-            if (!abbreviation.equals(title)) {
+            String title = 
title(provider.getFormat().getFormatSpecificationCitation()).toString(locale);
+            final String abbreviation = provider.getShortName();
+            if (abbreviation != null && !abbreviation.equals(title)) {
                 title = resources.getString(Vocabulary.Keys.Parenthesis_2, 
title, abbreviation);
             }
             list[i++] = capabilities;
@@ -109,16 +110,13 @@ public enum Capability {
 
     /**
      * Returns the title or alternate title of the given citation, or 
"untitled" if none.
-     *
-     * @param  preferTitle  {@code true} for preferring the title over 
alternate titles, or {@code false} for the opposite.
      */
-    private static InternationalString title(final Citation spec, final 
boolean preferTitle) {
-        final InternationalString title = spec.getTitle();
-        if (preferTitle && title != null) return title;
-        for (final InternationalString t : spec.getAlternateTitles()) {
+    private static InternationalString title(final Citation specification) {
+        final InternationalString title = specification.getTitle();
+        if (title != null) return title;
+        for (final InternationalString t : specification.getAlternateTitles()) 
{
             if (t != null) return t;
         }
-        if (title != null) return title;
         return Vocabulary.formatInternational(Vocabulary.Keys.Untitled);
     }
 }


Reply via email to