sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 01/03: Post-merge cleanup.
Date Mon, 06 May 2019 12:48:26 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 43a1a895f28717819a1edf3b3c2726e68f16c2fa
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Mon May 6 00:29:07 2019 +0200

    Post-merge cleanup.
---
 .../org/apache/sis/metadata/iso/DefaultMetadata.java  | 19 +++----------------
 .../apache/sis/metadata/PropertyConsistencyCheck.java |  6 ++----
 .../apache/sis/metadata/iso/CustomMetadataTest.java   |  2 +-
 pom.xml                                               |  6 +++---
 4 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
index d67d579..9bf01db 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
@@ -651,7 +651,7 @@ public class DefaultMetadata extends ISOMetadata implements Metadata {
     @Dependencies("getLocalesAndCharsets")
     public Collection<Charset> getCharacterSets() {
         // TODO: delete after SIS 1.0 release (method not needed by JAXB).
-        return FilterByVersion.LEGACY_METADATA.accept() ? LocaleAndCharset.getCharacterSets(getLocalesAndCharsets())
: null;
+        return LocaleAndCharset.getCharacterSets(getLocalesAndCharsets());
     }
 
     /**
@@ -681,20 +681,8 @@ public class DefaultMetadata extends ISOMetadata implements Metadata
{
     @Dependencies("getLocalesAndCharsets")
     // @XmlElement at the end of this class.
     public CharacterSet getCharacterSet() {
-        final Charset cs = LegacyPropertyAdapter.getSingleton(getCharacterSets(),
-                Charset.class, null, DefaultMetadata.class, "getCharacterSet");
-        if (cs != null) {
-            final String name = cs.name();
-            for (final CharacterSet candidate : CharacterSet.values()) {
-                for (final String n : candidate.names()) {
-                    if (name.equals(n)) {
-                        return candidate;
-                    }
-                }
-            }
-            return CharacterSet.valueOf(name);
-        }
-        return null;
+        return CharacterSet.fromCharset(LegacyPropertyAdapter.getSingleton(getCharacterSets(),
+                Charset.class, null, DefaultMetadata.class, "getCharacterSet"));
     }
 
     /**
@@ -1632,7 +1620,6 @@ public class DefaultMetadata extends ISOMetadata implements Metadata
{
     /**
      * Returns the character coding for the metadata set (used in legacy ISO 19157 format).
      */
-    @Dependencies("getLocalesAndCharsets")
     @XmlElement(name = "characterSet", namespace = LegacyNamespaces.GMD)
     private Charset getCharset() {
         if (FilterByVersion.LEGACY_METADATA.accept()) {
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyConsistencyCheck.java
b/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyConsistencyCheck.java
index b9c6cea..4f73282 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyConsistencyCheck.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyConsistencyCheck.java
@@ -22,7 +22,6 @@ import java.util.Random;
 import java.util.Collection;
 import java.util.Map;
 import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
 import org.opengis.util.CodeList;
 import org.opengis.util.ControlledVocabulary;
 import org.apache.sis.util.Numbers;
@@ -375,12 +374,11 @@ public abstract strictfp class PropertyConsistencyCheck extends AnnotationConsis
                             names = standard.asNameMap(type, KeyNamePolicy.JAVABEANS_PROPERTY,
KeyNamePolicy.METHOD_NAME);
                         }
                         /*
-                         * Currently, @Dependencies is applied mostly on deprecated getter
methods.
+                         * Currently, @Dependencies is applied only on deprecated getter
methods.
                          * However this policy may change in future Apache SIS versions.
                          */
                         assertTrue(name, name.startsWith("get"));
-                        assertTrue(name, method.isAnnotationPresent(Deprecated.class)
-                                         || Modifier.isPrivate(method.getModifiers()));
+                        assertTrue(name, method.isAnnotationPresent(Deprecated.class));
                         /*
                          * All dependencies shall be non-deprecated methods. Combined with
above
                          * restriction about @Dependencies applied only on deprected methods,
this
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java
b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java
index 5dc44ac..fcd71fe 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java
@@ -20,10 +20,10 @@ import java.util.Map;
 import java.util.HashMap;
 import java.util.Collection;
 import java.util.Locale;
+import java.nio.charset.Charset;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Method;
 import java.lang.reflect.InvocationHandler;
-import java.nio.charset.Charset;
 import javax.xml.bind.JAXBException;
 import org.opengis.util.NameFactory;
 import org.opengis.metadata.Identifier;
diff --git a/pom.xml b/pom.xml
index 5274a77..a013ca8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -632,7 +632,7 @@
       <!-- Compile -->
       <plugin>
         <artifactId>maven-compiler-plugin</artifactId>
-        <version>3.8.0</version>
+        <version>3.8.1</version>
         <configuration>
           <release>${maven.compiler.target}</release>
           <encoding>${project.build.sourceEncoding}</encoding>
@@ -649,7 +649,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.22.1</version>
+        <version>2.22.2</version>
         <configuration>
           <includes>
             <include>**/*TestSuite.java</include>
@@ -727,7 +727,7 @@
           <dependency>
             <groupId>com.puppycrawl.tools</groupId>
             <artifactId>checkstyle</artifactId>
-            <version>8.18</version>
+            <version>8.20</version>
           </dependency>
         </dependencies>
         <executions>


Mime
View raw message