sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1546841 - in /sis/branches/JDK7/core: sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingTypes.java sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java
Date Sun, 01 Dec 2013 19:36:44 GMT
Author: desruisseaux
Date: Sun Dec  1 19:36:44 2013
New Revision: 1546841

URL: http://svn.apache.org/r1546841
Log:
Added a temporary workaround for avoiding JAXB annotation conflicts while porting Geotk to
SIS.

Modified:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingTypes.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingTypes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingTypes.java?rev=1546841&r1=1546840&r2=1546841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingTypes.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingTypes.java
[UTF-8] Sun Dec  1 19:36:44 2013
@@ -36,6 +36,23 @@ public final class ReferencingTypes exte
      */
     @Override
     public void getTypes(final Collection<Class<?>> addTo) {
+        if (exists(addTo)) return;
         addTo.add(AbstractIdentifiedObject.class);
     }
+
+    /**
+     * Temporary workaround for avoiding a conflict between SIS and Geotk JAXB annotations.
+     * To be removed after we finished the port of Geotk referencing module to Apache SIS.
+     *
+     * @deprecated To be removed after sis-referencing completion.
+     */
+    @Deprecated
+    private static boolean exists(final Collection<Class<?>> addTo) {
+        for (final Class<?> type : addTo) {
+            if (org.opengis.referencing.crs.CoordinateReferenceSystem.class.isAssignableFrom(type))
{
+                return true;
+            }
+        }
+        return false;
+    }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java?rev=1546841&r1=1546840&r2=1546841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/TypeRegistration.java
[UTF-8] Sun Dec  1 19:36:44 2013
@@ -49,11 +49,13 @@ public abstract class TypeRegistration {
     /**
      * The JAXB context, or {@code null} if not yet created or if the classpath changed.
      */
-    private static volatile Reference<JAXBContext> context;
+    private static Reference<JAXBContext> context;
     static {
         SystemListener.add(new SystemListener(Modules.UTILITIES) {
             @Override protected void classpathChanged() {
-                context = null;
+                synchronized (TypeRegistration.class) {
+                    context = null;
+                }
             }
         });
     }



Mime
View raw message