sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1553456 [4/4] - in /sis/branches/JDK6: ./ core/sis-metadata/src/main/java/org/apache/sis/metadata/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ core/sis-metadata/...
Date Thu, 26 Dec 2013 06:00:51 GMT
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/XLink.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/XLink.java?rev=1553456&r1=1553455&r2=1553456&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/XLink.java [UTF-8]
(original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/XLink.java [UTF-8]
Thu Dec 26 06:00:48 2013
@@ -25,7 +25,6 @@ import javax.xml.bind.annotation.XmlAttr
 import javax.xml.bind.annotation.XmlTransient;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.Classes;
-import org.apache.sis.util.ThreadSafe;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.resources.Errors;
 
@@ -79,7 +78,6 @@ import org.apache.sis.internal.jdk7.Obje
  * @see <a href="http://www.w3.org/TR/xlink/">XML Linking Language</a>
  * @see <a href="http://schemas.opengis.net/xlink/1.0.0/xlinks.xsd">OGC schema</a>
  */
-@ThreadSafe
 @XmlTransient
 public class XLink implements Serializable {
     /**
@@ -342,7 +340,7 @@ public class XLink implements Serializab
      * @return The type of link, or {@code null}.
      */
     @XmlAttribute(name = "type", namespace = Namespaces.XLINK, required = true)
-    public synchronized Type getType() {
+    public Type getType() {
         if (type != Type.AUTO) {
             return type;
         }
@@ -380,7 +378,7 @@ public class XLink implements Serializab
      *
      * @param type The new type of link, or {@code null} if none.
      */
-    public synchronized void setType(final Type type) {
+    public void setType(final Type type) {
         canWrite(0x1, "type", "type"); // We want a non-null value in all cases.
         if (type != null && (fieldMask() & ~type.fieldMask) != 0) {
             throw new IllegalStateException(Errors.format(Errors.Keys.InconsistentAttribute_2,
"type", type.identifier()));
@@ -428,7 +426,7 @@ public class XLink implements Serializab
      * @category locator
      */
     @XmlAttribute(name = "href", namespace = Namespaces.XLINK)
-    public synchronized URI getHRef() {
+    public URI getHRef() {
         return href;
     }
 
@@ -442,7 +440,7 @@ public class XLink implements Serializab
      *
      * @category locator
      */
-    public synchronized void setHRef(final URI href) throws IllegalStateException {
+    public void setHRef(final URI href) throws IllegalStateException {
         canWrite(0x2, "href", href);
         this.href = href;
     }
@@ -455,7 +453,7 @@ public class XLink implements Serializab
      * @category semantic
      */
     @XmlAttribute(name = "role", namespace = Namespaces.XLINK)
-    public synchronized URI getRole() {
+    public URI getRole() {
         return role;
     }
 
@@ -469,7 +467,7 @@ public class XLink implements Serializab
      *
      * @category semantic
      */
-    public synchronized void setRole(final URI role) throws IllegalStateException {
+    public void setRole(final URI role) throws IllegalStateException {
         canWrite(0x4, "role", role);
         this.role = role;
     }
@@ -482,7 +480,7 @@ public class XLink implements Serializab
      * @category semantic
      */
     @XmlAttribute(name = "arcrole", namespace = Namespaces.XLINK)
-    public synchronized URI getArcRole() {
+    public URI getArcRole() {
         return arcrole;
     }
 
@@ -496,7 +494,7 @@ public class XLink implements Serializab
      *
      * @category semantic
      */
-    public synchronized void setArcRole(final URI arcrole) throws IllegalStateException {
+    public void setArcRole(final URI arcrole) throws IllegalStateException {
         canWrite(0x8, "arcrole", arcrole);
         this.arcrole = arcrole;
     }
@@ -509,7 +507,7 @@ public class XLink implements Serializab
      * @category semantic
      */
     @XmlAttribute(name = "title", namespace = Namespaces.XLINK)
-    public synchronized InternationalString getTitle() {
+    public InternationalString getTitle() {
         return title;
     }
 
@@ -524,7 +522,7 @@ public class XLink implements Serializab
      *
      * @category semantic
      */
-    public synchronized void setTitle(final InternationalString title) throws IllegalStateException
{
+    public void setTitle(final InternationalString title) throws IllegalStateException {
         canWrite(0x10, "title", title);
         this.title = title;
     }
@@ -585,7 +583,7 @@ public class XLink implements Serializab
      * @category behavior
      */
     @XmlAttribute(name = "show", namespace = Namespaces.XLINK)
-    public synchronized Show getShow() {
+    public Show getShow() {
         return show;
     }
 
@@ -599,7 +597,7 @@ public class XLink implements Serializab
      *
      * @category behavior
      */
-    public synchronized void setShow(final Show show) throws IllegalStateException {
+    public void setShow(final Show show) throws IllegalStateException {
         canWrite(0x20, "show", show);
         this.show = show;
     }
@@ -656,7 +654,7 @@ public class XLink implements Serializab
      * @category behavior
      */
     @XmlAttribute(name = "actuate", namespace = Namespaces.XLINK)
-    public synchronized Actuate getActuate() {
+    public Actuate getActuate() {
         return actuate;
     }
 
@@ -671,7 +669,7 @@ public class XLink implements Serializab
      *
      * @category behavior
      */
-    public synchronized void setActuate(final Actuate actuate) throws IllegalStateException
{
+    public void setActuate(final Actuate actuate) throws IllegalStateException {
         canWrite(0x40, "actuate", actuate);
         this.actuate = actuate;
     }
@@ -683,7 +681,7 @@ public class XLink implements Serializab
      *
      * @category traversal
      */
-    public synchronized String getLabel() {
+    public String getLabel() {
         return label;
     }
 
@@ -697,7 +695,7 @@ public class XLink implements Serializab
      *
      * @category traversal
      */
-    public synchronized void setLabel(final String label) throws IllegalStateException {
+    public void setLabel(final String label) throws IllegalStateException {
         canWrite(0x80, "label", label);
         this.label = label;
     }
@@ -710,7 +708,7 @@ public class XLink implements Serializab
      *
      * @category traversal
      */
-    public synchronized String getFrom() {
+    public String getFrom() {
         return from;
     }
 
@@ -725,7 +723,7 @@ public class XLink implements Serializab
      *
      * @category traversal
      */
-    public synchronized void setFrom(final String from) throws IllegalStateException {
+    public void setFrom(final String from) throws IllegalStateException {
         canWrite(0x100, "from", from);
         this.from = from;
     }
@@ -738,7 +736,7 @@ public class XLink implements Serializab
      *
      * @category traversal
      */
-    public synchronized String getTo() {
+    public String getTo() {
         return to;
     }
 
@@ -753,7 +751,7 @@ public class XLink implements Serializab
      *
      * @category traversal
      */
-    public synchronized void setTo(final String to) throws IllegalStateException {
+    public void setTo(final String to) throws IllegalStateException {
         canWrite(0x200, "to", to);
         this.to = to;
     }
@@ -764,7 +762,7 @@ public class XLink implements Serializab
      *
      * <p>After the first call to this method, any subsequent calls have no effect.</p>
      */
-    public synchronized void freeze() {
+    public void freeze() {
         if (hashCode == 0) {
             hashCode = hash();
         }
@@ -776,7 +774,7 @@ public class XLink implements Serializab
      * @param object The object to compare with this XLink.
      */
     @Override
-    public synchronized boolean equals(final Object object) {
+    public boolean equals(final Object object) {
         if (object == this) {
             return true;
         }
@@ -807,7 +805,7 @@ public class XLink implements Serializab
      * Returns a hash code value for this XLink.
      */
     @Override
-    public synchronized int hashCode() {
+    public int hashCode() {
         int hash = hashCode;
         if (hash == 0) {
             hash = hash();
@@ -837,7 +835,7 @@ public class XLink implements Serializab
      * }
      */
     @Override
-    public synchronized String toString() {
+    public String toString() {
         final StringBuilder buffer = new StringBuilder(64);
         buffer.append(Classes.getShortClassName(this)).append('[');
         append(buffer, "type",    getType());

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/CheckedArrayListTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/CheckedArrayListTest.java?rev=1553456&r1=1553455&r2=1553456&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/CheckedArrayListTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/CheckedArrayListTest.java
[UTF-8] Thu Dec 26 06:00:48 2013
@@ -67,7 +67,7 @@ public final strictfp class CheckedArray
             list.add(null);
         } catch (NullArgumentException e) {
             final String message = e.getMessage();
-            assertTrue("element", message.contains("element"));
+            assertTrue(message.contains("CheckedArrayList<String>"));
         }
     }
 
@@ -82,7 +82,7 @@ public final strictfp class CheckedArray
             list.addAll(toAdd);
         } catch (NullArgumentException e) {
             final String message = e.getMessage();
-            assertTrue("element", message.contains("element"));
+            assertTrue(message.contains("CheckedArrayList<String>"));
         }
     }
 

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/io/EchoAppendable.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/io/EchoAppendable.java?rev=1553456&r1=1553455&r2=1553456&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/io/EchoAppendable.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/io/EchoAppendable.java
[UTF-8] Thu Dec 26 06:00:48 2013
@@ -17,7 +17,6 @@
 package org.apache.sis.io;
 
 import java.io.IOException;
-import org.apache.sis.util.Decorator;
 
 import static org.junit.Assert.*;
 
@@ -33,7 +32,6 @@ import static org.junit.Assert.*;
  * @version 0.3
  * @module
  */
-@Decorator(Appendable.class)
 public class EchoAppendable extends Appender {
     /**
      * The echo writer.
@@ -54,6 +52,8 @@ public class EchoAppendable extends Appe
     /**
      * Writes a single character.
      *
+     * @param  c The character to append.
+     * @return {@code this}.
      * @throws IOException If an I/O error occurs.
      */
     @Override
@@ -67,6 +67,7 @@ public class EchoAppendable extends Appe
      * Writes a character sequence.
      *
      * @param  sequence The character sequence to be written.
+     * @return {@code this}.
      * @throws IOException If an I/O error occurs.
      */
     @Override
@@ -82,6 +83,7 @@ public class EchoAppendable extends Appe
      * @param  sequence The character sequence to be written.
      * @param  start    Index from which to start reading characters.
      * @param  end      Index of the character following the last character to read.
+     * @return {@code this}.
      * @throws IOException If an I/O error occurs.
      */
     @Override

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java?rev=1553456&r1=1553455&r2=1553456&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/measure/UnitsTest.java
[UTF-8] Thu Dec 26 06:00:48 2013
@@ -50,7 +50,8 @@ import static org.apache.sis.test.Assert
  */
 @DependsOn({
     SexagesimalConverterTest.class,
-    org.apache.sis.internal.util.URIParserTest.class
+    org.apache.sis.internal.util.DefinitionURITest.class,
+    org.apache.sis.internal.util.XPathsTest.class
 })
 public final strictfp class UnitsTest extends TestCase {
     /**

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java?rev=1553456&r1=1553455&r2=1553456&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java
[UTF-8] Thu Dec 26 06:00:48 2013
@@ -634,7 +634,7 @@ public strictfp class XMLComparator {
         actual   = trim(actual);
         if ((expected != actual) && (expected == null || !expected.equals(actual)))
{
             // Before to declare a test failure, compares again as numerical values if possible.
-            if (tolerance > 0 && abs(doubleValue(expected) - doubleValue(actual))
<= tolerance) {
+            if (abs(doubleValue(expected) - doubleValue(actual)) <= tolerance) {
                 return;
             }
             final String lineSeparator = JDK7.lineSeparator();

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java?rev=1553456&r1=1553455&r2=1553456&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
[UTF-8] Thu Dec 26 06:00:48 2013
@@ -78,7 +78,8 @@ import org.junit.BeforeClass;
     org.apache.sis.internal.util.CollectionsExtTest.class,
 
     // GeoAPI most basic types.
-    org.apache.sis.internal.util.URIParserTest.class,
+    org.apache.sis.internal.util.DefinitionURITest.class,
+    org.apache.sis.internal.util.XPathsTest.class,
     org.apache.sis.util.iso.TypesTest.class,
     org.apache.sis.util.iso.SimpleInternationalStringTest.class,
     org.apache.sis.util.iso.DefaultInternationalStringTest.class,

Modified: sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java?rev=1553456&r1=1553455&r2=1553456&view=diff
==============================================================================
--- sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
[UTF-8] (original)
+++ sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
[UTF-8] Thu Dec 26 06:00:48 2013
@@ -103,6 +103,8 @@ public class NetcdfStore extends DataSto
     /**
      * Returns a string representation of this NetCDF store for debugging purpose.
      * The content of the string returned by this method may change in any future SIS version.
+     *
+     * @return A string representation of this datastore for debugging purpose.
      */
     @Debug
     @Override

Modified: sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java?rev=1553456&r1=1553455&r2=1553456&view=diff
==============================================================================
--- sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
[UTF-8] Thu Dec 26 06:00:48 2013
@@ -36,7 +36,6 @@ import org.apache.sis.storage.DataStoreE
 import org.apache.sis.storage.ProbeResult;
 import org.apache.sis.util.logging.WarningListeners;
 import org.apache.sis.util.logging.Logging;
-import org.apache.sis.util.ThreadSafe;
 import org.apache.sis.util.Version;
 
 
@@ -47,6 +46,10 @@ import org.apache.sis.util.Version;
  * on the classpath, then this class tries to instantiate a {@code NetcdfStore} backed by
  * the UCAR library.
  *
+ * {@section Thread safety}
+ * The same {@code NetcdfStoreProvider} instance can be safely used by many threads without
synchronization on
+ * the part of the caller. However the {@link NetcdfStore} instances created by this factory
are not thread-safe.
+ *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
  * @version 0.4
@@ -54,7 +57,6 @@ import org.apache.sis.util.Version;
  *
  * @see NetcdfStore
  */
-@ThreadSafe
 public class NetcdfStoreProvider extends DataStoreProvider {
     /**
      * The MIME type for NetCDF files.
@@ -199,7 +201,9 @@ public class NetcdfStoreProvider extends
     /**
      * Returns a {@link NetcdfStore} implementation associated with this provider.
      *
-     * @param storage Information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile}
instance, <i>etc</i>).
+     * @param  storage Information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile}
instance, <i>etc</i>).
+     * @return A data store implementation associated with this provider for the given storage.
+     * @throws DataStoreException If an error occurred while creating the data store instance.
      */
     @Override
     public DataStore open(final StorageConnector storage) throws DataStoreException {

Modified: sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java?rev=1553456&r1=1553455&r2=1553456&view=diff
==============================================================================
--- sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java
[UTF-8] Thu Dec 26 06:00:48 2013
@@ -16,8 +16,6 @@
  */
 package org.apache.sis.storage;
 
-import org.apache.sis.util.ThreadSafe;
-
 
 /**
  * Provides information about a specific {@link DataStore} implementation.
@@ -42,7 +40,7 @@ import org.apache.sis.util.ThreadSafe;
  * where each line is the fully qualified name of the implementation class.
  * See {@link java.util.ServiceLoader} for more general discussion about this lookup mechanism.
  *
- * {@section Thread safety policy}
+ * {@section Thread safety}
  * All {@code DataStoreProvider} implementations shall be thread-safe.
  * However the {@code DataStore} instances created by the providers do not need to be thread-safe.
  *
@@ -51,7 +49,6 @@ import org.apache.sis.util.ThreadSafe;
  * @version 0.4
  * @module
  */
-@ThreadSafe
 public abstract class DataStoreProvider {
     /**
      * Creates a new provider.
@@ -123,7 +120,6 @@ public abstract class DataStoreProvider 
      *
      * @param  storage Information about the storage (URL, stream, JDBC connection, <i>etc</i>).
      * @return A data store implementation associated with this provider for the given storage.
-     * @throws IllegalArgumentException If the set contains an invalid combination of options.
      * @throws DataStoreException If an error occurred while creating the data store instance.
      *
      * @see DataStores#open(Object)

Modified: sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java?rev=1553456&r1=1553455&r2=1553456&view=diff
==============================================================================
--- sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
[UTF-8] (original)
+++ sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
[UTF-8] Thu Dec 26 06:00:48 2013
@@ -20,7 +20,6 @@ import java.util.List;
 import java.util.LinkedList;
 import java.util.Iterator;
 import java.util.ServiceLoader;
-import org.apache.sis.util.ThreadSafe;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
 
@@ -33,12 +32,15 @@ import org.apache.sis.util.resources.Err
  * {@note This class is package-private for now in order to get more experience about what
could be a good API.
  *        This class may become public in a future SIS version.}
  *
+ * {@section Thread safety}
+ * The same {@code DataStoreRegistry} instance can be safely used by many threads without
synchronization
+ * on the part of the caller.
+ *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
  * @version 0.4
  * @module
  */
-@ThreadSafe
 final class DataStoreRegistry {
     /**
      * The loader to use for searching for {@link DataStoreProvider} implementations.



Mime
View raw message