sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1605685 - /sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
Date Thu, 26 Jun 2014 07:49:05 GMT
Author: desruisseaux
Date: Thu Jun 26 07:49:04 2014
New Revision: 1605685

URL: http://svn.apache.org/r1605685
Log:
Fixed a NullPointerException.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java?rev=1605685&r1=1605684&r2=1605685&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java
[UTF-8] Thu Jun 26 07:49:04 2014
@@ -316,7 +316,11 @@ public class DefaultMaintenanceInformati
     @Deprecated
     @XmlElement(name = "updateScope")
     public Collection<ScopeCode> getUpdateScopes() {
-        return new LegacyProperties<ScopeCode,Scope>(getMaintenanceScopes()) {
+        final Collection<Scope> scopes = getMaintenanceScopes();
+        if (scopes == null) {
+            return null; // May happen at marshalling time.
+        }
+        return new LegacyProperties<ScopeCode,Scope>(scopes) {
             @Override protected Scope wrap(final ScopeCode code) {
                 return new DefaultScope(code);
             }
@@ -368,7 +372,11 @@ public class DefaultMaintenanceInformati
     @Deprecated
     @XmlElement(name = "updateScopeDescription")
     public Collection<ScopeDescription> getUpdateScopeDescriptions() {
-        return new LegacyProperties<ScopeDescription,Scope>(getMaintenanceScopes())
{
+        final Collection<Scope> scopes = getMaintenanceScopes();
+        if (scopes == null) {
+            return null; // May happen at marshalling time.
+        }
+        return new LegacyProperties<ScopeDescription,Scope>(scopes) {
             private boolean warningOccurred;
 
             @Override protected Scope wrap(final ScopeDescription code) {



Mime
View raw message