sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1779772 - in /sis/branches/JDK8/core/sis-metadata/src: main/java/org/apache/sis/metadata/MetadataStandard.java test/java/org/apache/sis/metadata/MetadataStandardTest.java
Date Sun, 22 Jan 2017 05:49:20 GMT
Author: desruisseaux
Date: Sun Jan 22 05:49:19 2017
New Revision: 1779772

URL: http://svn.apache.org/viewvc?rev=1779772&view=rev
Log:
Fix an AssertionError when StandardMetadata.isMetadata(Class<?>) is invoked with a primitive
type.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java?rev=1779772&r1=1779771&r2=1779772&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
[UTF-8] Sun Jan 22 05:49:19 2017
@@ -324,7 +324,7 @@ public class MetadataStandard implements
          */
         final Class<?> type;
         if (value instanceof Class<?>) {
-            type = (Class<?>) value;                            // Stored result of
previous call to findInterface(…).
+            type = (Class<?>) value;                        // Stored result of previous
call to findInterface(…).
             assert type == findInterface(key) : key;
         } else if (key.isValid()) {
             /*
@@ -380,7 +380,7 @@ public class MetadataStandard implements
      *         or implements an interface of this standard.
      */
     public boolean isMetadata(final Class<?> type) {
-        return (type != null) && isMetadata(new CacheKey(type));
+        return (type != null) && !type.isPrimitive() && isMetadata(new CacheKey(type));
     }
 
     /**

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=1779772&r1=1779771&r2=1779772&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] Sun Jan 22 05:49:19 2017
@@ -94,6 +94,8 @@ public final strictfp class MetadataStan
         assertFalse("isMetadata(SimpleIdentifiedObject)", isMetadata(SimpleIdentifiedObject.class));
         assertFalse("isMetadata(GeographicCRS)",          isMetadata(GeographicCRS.class));
         assertFalse("isMetadata(RectifiedGrid)",          isMetadata(RectifiedGrid.class));
+        assertFalse("isMetadata(Double)",                 isMetadata(Double.class));
+        assertFalse("isMetadata(double)",                 isMetadata(Double.TYPE));
 
         standard = MetadataStandard.ISO_19111;
         assertFalse("isMetadata(String)",                 isMetadata(String.class));



Mime
View raw message