sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1534802 [2/2] - 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/main/java/org/apache/sis/metadata/iso/maintenance/ core/s...
Date Tue, 22 Oct 2013 21:33:10 GMT
Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/CollectionsExt.java
[UTF-8] Tue Oct 22 21:33:09 2013
@@ -17,6 +17,7 @@
 package org.apache.sis.internal.util;
 
 import java.util.*;
+import java.lang.reflect.Array;
 import org.apache.sis.util.Static;
 import org.apache.sis.util.collection.CodeListSet;
 import org.apache.sis.util.resources.Errors;
@@ -92,16 +93,29 @@ public final class CollectionsExt extend
     }
 
     /**
+     * Returns the given array if non-empty, or {@code null} if the given array is null or
empty.
+     * This method is generally not recommended, since public API should prefer empty array
instead of null.
+     * However this method is occasionally useful for managing private fields.
+     *
+     * @param  <E> The type of elements in the array.
+     * @param  array The array, or {@code null}.
+     * @return The given array, or {@code null} if the given array was empty.
+     */
+    public static <E> E[] nonEmpty(final E[] array) {
+        return (array != null && array.length == 0) ? null : array;
+    }
+
+    /**
      * Returns the given collection if non-empty, or {@code null} if the given collection
is null or empty.
-     * This method is generally not recommended, since public API should prefer empty collection
instead of
-     * null. However it is occasionally useful for managing private fields, especially for
inter-operability
+     * This method is generally not recommended, since public API should prefer empty collection
instead of null.
+     * However this method is occasionally useful for managing private fields, especially
for inter-operability
      * with frameworks that may expect or return null (e.g. if we want to exclude completely
an empty collection
      * from marshalling with JAXB).
      *
      * @param  <T> The type of the collection.
      * @param  <E> The type of elements in the collection.
      * @param  c   The collection, or {@code null}.
-     * @return The given collection, or an empty set of the given collection was null.
+     * @return The given collection, or {@code null} if the given collection was empty.
      */
     public static <T extends Collection<E>, E> T nonEmpty(final T c) {
         return (c != null && c.isEmpty()) ? null : c;
@@ -112,7 +126,7 @@ public final class CollectionsExt extend
      *
      * @param  <E> The type of elements in the collection.
      * @param  c The collection, or {@code null}.
-     * @return The given collection, or an empty set of the given collection was null.
+     * @return The given collection, or an empty set if the given collection was null.
      */
     public static <E> Collection<E> nonNull(final Collection<E> c) {
         return (c != null) ? c : Collections.<E>emptySet();
@@ -123,13 +137,68 @@ public final class CollectionsExt extend
      *
      * @param  <E> The type of elements in the collection.
      * @param  c The collection, or {@code null}.
-     * @return The given collection, or an empty set of the given collection was null.
+     * @return The given collection, or an empty set if the given collection was null.
      */
     public static <E> Set<E> nonNull(final Set<E> c) {
         return (c != null) ? c : Collections.<E>emptySet();
     }
 
     /**
+     * Given a value which is either {@code null}, an instance of {@code <E>} or an
array of {@code <E>},
+     * returns a non-null array containing all elements without null and without duplicated
values.
+     * More specifically:
+     *
+     * <ul>
+     *   <li>If the given value is {@code null}, then this method returns {@code emptyArray}.</li>
+     *   <li>If the given value is an instance of {@code <E>}, then this method
returns an array of length 1
+     *       which contain only {@code value}.</li>
+     *   <li>If the given value is an array of {@code <E>}, then this method
returns copy of that array,
+     *       omitting {@code null} elements and duplicated elements.</li>
+     *   <li>Otherwise this method throws {@link IllegalArgumentException}.</li>
+     * </ul>
+     *
+     * {@note It would be very easy to add support for <code>value</code> argument
of type <code>Object[]</code>
+     *        or collections. But we do not provide such support for now because this method
is used mostly as a
+     *        helper method for constructors of <code>AbstractIdentifiedObject</code>
subclasses receiving a map
+     *        of properties, and the contract of our constructors do not allow those other
types for now.}
+     *
+     * @param  <E>        The type of elements in the array to be returned.
+     * @param  name       The parameter name, used only for formatting an error message in
case of failure.
+     * @param  value      The value to return as an array, or {@code null}.
+     * @param  emptyArray An instance of {@code new E[0]}. This argument can not be null.
+     * @return The given value as an array of {@code <E>}. Never null.
+     * throws  IllegalArgumentException If the given value is not null, an instance of {@code
<E>}
+     *         or an array of {@code <E>}.
+     *
+     * @since 0.4
+     */
+    @SuppressWarnings("unchecked")
+    public static <E> E[] nonNullArraySet(final String name, final Object value, final
E[] emptyArray)
+            throws IllegalArgumentException
+    {
+        if (value == null) {
+            return emptyArray;
+        }
+        Class<?> type = emptyArray.getClass();
+        final Class<?> valueType = value.getClass();
+        if (valueType.isArray()) {
+            if (type.isAssignableFrom(valueType)) {
+                final Set<E> set = new LinkedHashSet<E>(Arrays.asList((E[]) value));
+                set.remove(null);
+                return set.toArray(emptyArray);
+            }
+        } else {
+            type = type.getComponentType();
+            if (type.isAssignableFrom(valueType)) {
+                final E[] array = (E[]) Array.newInstance(type, 1);
+                array[0] = (E) value;
+                return array;
+            }
+        }
+        throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalPropertyClass_2,
name, valueType));
+    }
+
+    /**
      * Returns the specified array as an immutable set, or {@code null} if the array is null.
      * If the given array contains duplicated elements, i.e. elements that are equal in the
      * sense of {@link Object#equals(Object)}, then only the last instance of the duplicated

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java
[UTF-8] Tue Oct 22 21:33:09 2013
@@ -696,6 +696,16 @@ public final class DoubleDouble extends 
     }
 
     /**
+     * Sets this double-double value to its square root.
+     *
+     * @todo This method is not yet implemented with double-double precision.
+     */
+    public void sqrt() {
+        value = Math.sqrt(value);
+        error = 0;
+    }
+
+    /**
      * Returns a string representation of this number for debugging purpose.
      * The returned string does not need to contains all digits that this {@code DoubleDouble}
can handle.
      *

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/LineAppender.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/LineAppender.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/LineAppender.java [UTF-8]
(original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/LineAppender.java [UTF-8]
Tue Oct 22 21:33:09 2013
@@ -59,7 +59,7 @@ import org.apache.sis.internal.jdk7.JDK7
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.00)
- * @version 0.3
+ * @version 0.4
  * @module
  */
 @Decorator(Appendable.class)
@@ -563,6 +563,7 @@ searchHyp:  for (int i=buffer.length(); 
     public void flush() throws IOException {
         out.append(buffer);
         buffer.setLength(0);
+        printableLength = 0;
         IO.flush(out);
     }
 

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/FunctionProperty.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/FunctionProperty.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/FunctionProperty.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/FunctionProperty.java
[UTF-8] Tue Oct 22 21:33:09 2013
@@ -144,7 +144,7 @@ public enum FunctionProperty {
      *
      * @see #isBijective(Set)
      */
-    private static EnumSet<FunctionProperty> BIJECTIVE = EnumSet.of(INJECTIVE, SURJECTIVE);
+    private static final EnumSet<FunctionProperty> BIJECTIVE = EnumSet.of(INJECTIVE,
SURJECTIVE);
 
     /**
      * Returns {@code true} if a function having the given set of properties is <cite>bijective</cite>.

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
[UTF-8] Tue Oct 22 21:33:09 2013
@@ -199,7 +199,8 @@ public final class MathFunctions extends
             dot.setToProduct(v1, v1);
             sum.add(dot);
         }
-        return Math.sqrt(sum.value);
+        sum.sqrt();
+        return sum.value;
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java
[UTF-8] Tue Oct 22 21:33:09 2013
@@ -183,6 +183,8 @@ public class CodeListSet<E extends CodeL
 
     /**
      * Returns {@code true} if this set does not contains any element.
+     *
+     * @return {@code true} if this set is empty.
      */
     @Override
     public boolean isEmpty() {
@@ -522,7 +524,9 @@ public class CodeListSet<E extends CodeL
     }
 
     /**
-     * Returns a clone of this set.
+     * Returns a new set of the same class containing the same elements than this set.
+     *
+     * @return A clone of this set.
      */
     @Override
     @SuppressWarnings("unchecked")

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
[UTF-8] Tue Oct 22 21:33:09 2013
@@ -48,7 +48,7 @@ import org.apache.sis.internal.jdk7.JDK7
  * this formatter uses only one line per message instead of two. For example messages formatted
by
  * {@code MonolineFormatter} may look like:
  *
- * <blockquote><table style="color:#FFFFFF; background:black" class="compact">
+ * <blockquote><table style="color:white; background:black" class="compact">
  * <tr><td><code>00:01</code></td><td style="background:blue"><code>CONFIG</code></td>
  *     <td><code><b>[MyApplication]</b> Read configuration from “my-application/setup.xml”.</code></td></tr>
  * <tr><td><code>00:03</code></td><td style="background:green"><code>INFO</code></td>
@@ -104,7 +104,7 @@ import org.apache.sis.internal.jdk7.JDK7
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-2.0)
- * @version 0.3
+ * @version 0.4
  * @module
  *
  * @see SimpleFormatter
@@ -603,8 +603,8 @@ loop:   for (int i=0; ; i++) {
                 buffer.append(colorAt(level));
             }
             final int offset = buffer.length();
-            buffer.append(level.getLocalizedName());
-            buffer.append(CharSequences.spaces(levelWidth - (buffer.length() - offset)));
+            buffer.append(level.getLocalizedName())
+                  .append(CharSequences.spaces(levelWidth - (buffer.length() - offset)));
             margin += buffer.length() - offset;
             if (colors) {
                 buffer.append(X364.BACKGROUND_DEFAULT.sequence());
@@ -633,7 +633,6 @@ loop:   for (int i=0; ; i++) {
                     break;
                 }
             }
-            source = source.replace('$', '.');
             if (colors && emphase) {
                 buffer.append(X364.BOLD.sequence());
             }

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] Tue Oct 22 21:33:09 2013
@@ -481,6 +481,11 @@ public final class Errors extends Indexe
         public static final int NonTemporalUnit_1 = 49;
 
         /**
+         * Scale is not uniform.
+         */
+        public static final int NonUniformScale = 126;
+
+        /**
          * Argument ‘{0}’ shall not be NaN (Not-a-Number).
          */
         public static final int NotANumber_1 = 9;
@@ -491,6 +496,11 @@ public final class Errors extends Indexe
         public static final int NotAPrimitiveWrapper_1 = 10;
 
         /**
+         * Matrix is not skew-symmetric.
+         */
+        public static final int NotASkewSymmetricMatrix = 127;
+
+        /**
          * Text “{0}” is not a Unicode identifier.
          */
         public static final int NotAUnicodeIdentifier_1 = 113;

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
[ISO-8859-1] Tue Oct 22 21:33:09 2013
@@ -104,9 +104,11 @@ NonAngularUnit_1                = \u201c
 NonLinearUnit_1                 = \u201c{0}\u201d is not a linear unit.
 NonScaleUnit_1                  = \u201c{0}\u201d is not a scale unit.
 NonTemporalUnit_1               = \u201c{0}\u201d is not a time unit.
+NonUniformScale                 = Scale is not uniform.
 NotAnAffineTransform            = Transform is not affine.
 NotANumber_1                    = Argument \u2018{0}\u2019 shall not be NaN (Not-a-Number).
 NotAPrimitiveWrapper_1          = Class \u2018{0}\u2019 is not a primitive type wrapper.
+NotASkewSymmetricMatrix         = Matrix is not skew-symmetric.
 NotAUnicodeIdentifier_1         = Text \u201c{0}\u201d is not a Unicode identifier.
 NotComparableClass_1            = Class \u2018{0}\u2019 is not a comparable.
 NoSuchElement_1                 = Element \u201c{0}\u201d has not been found.

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
[ISO-8859-1] Tue Oct 22 21:33:09 2013
@@ -94,9 +94,11 @@ NonAngularUnit_1                = \u201c
 NonLinearUnit_1                 = \u201c{0}\u201d n\u2019est pas une unit\u00e9 de longueurs.
 NonScaleUnit_1                  = \u201c{0}\u201d n\u2019est pas une unit\u00e9 d\u2019\u00e9chelles.
 NonTemporalUnit_1               = \u201c{0}\u201d n\u2019est pas une unit\u00e9 de temps.
+NonUniformScale                 = L\u2019\u00e9chelle n\u2019est pas uniforme.
 NotAnAffineTransform            = La transformation n\u2019est pas affine.
 NotANumber_1                    = L\u2019argument \u2018{0}\u2019 ne doit pas \u00eatre NaN
(Not-a-Number).
 NotAPrimitiveWrapper_1          = La classe \u2018{0}\u2019 n\u2019est pas un adaptateur
d\u2019un type primitif.
+NotASkewSymmetricMatrix         = La matrice n\u2019est pas antisym\u00e9trique.
 NotAUnicodeIdentifier_1         = Le texte \u201c{0}\u201d n\u2019est pas un identifiant
Unicode.
 NotComparableClass_1            = La classe \u2018{0}\u2019 n\u2019est pas comparable.
 NoSuchElement_1                 = L\u2019\u00e9lement \u201c{0}\u201d n\u2019a pas \u00e9t\u00e9
trouv\u00e9.

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
[UTF-8] Tue Oct 22 21:33:09 2013
@@ -320,6 +320,11 @@ public final class Vocabulary extends In
         public static final int TemporaryFiles = 31;
 
         /**
+         * {0} time
+         */
+        public static final int Time_1 = 64;
+
+        /**
          * Timezone
          */
         public static final int Timezone = 20;

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
[ISO-8859-1] Tue Oct 22 21:33:09 2013
@@ -67,6 +67,7 @@ Scale              = Scale
 Source             = Source
 StandardDeviation  = Standard deviation
 TemporaryFiles     = Temporary files
+Time_1             = {0} time
 Timezone           = Timezone
 TruncatedJulian    = Truncated Julian
 Type               = Type

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
[ISO-8859-1] Tue Oct 22 21:33:09 2013
@@ -67,6 +67,7 @@ Scale              = \u00c9chelle
 Source             = Source
 StandardDeviation  = \u00c9cart type
 TemporaryFiles     = Fichiers temporaires
+Time_1             = Heure {0}
 Timezone           = Fuseau horaire
 TruncatedJulian    = Julien tronqu\u00e9
 Type               = Type

Modified: sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/MarshallerPool.java
[UTF-8] Tue Oct 22 21:33:09 2013
@@ -154,7 +154,7 @@ public class MarshallerPool {
      * for the {@code Unmarshaller}, then consider overriding the {@link #createMarshaller()}
      * or {@link #createUnmarshaller()} methods instead.</p>
      *
-     * @param  properties The set of properties to be given to the (un)marshaller, or {@code
null} if none.
+     * @param  properties The properties to be given to the (un)marshaller, or {@code null}
if none.
      * @throws JAXBException If the JAXB context can not be created.
      */
     public MarshallerPool(final Map<String,?> properties) throws JAXBException {
@@ -172,7 +172,7 @@ public class MarshallerPool {
      * or {@link #createUnmarshaller()} methods instead.</p>
      *
      * @param  context The JAXB context.
-     * @param  properties The set of properties to be given to the (un)marshaller, or {@code
null} if none.
+     * @param  properties The properties to be given to the (un)marshaller, or {@code null}
if none.
      * @throws JAXBException If the marshaller pool can not be created.
      */
     @SuppressWarnings({"unchecked", "rawtypes"}) // Generic array creation

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/io/LineAppenderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/io/LineAppenderTest.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/io/LineAppenderTest.java
[UTF-8] (original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/io/LineAppenderTest.java
[UTF-8] Tue Oct 22 21:33:09 2013
@@ -19,6 +19,7 @@ package org.apache.sis.io;
 import java.io.IOException;
 import org.apache.sis.test.DependsOn;
 import org.junit.Before;
+import org.junit.Test;
 
 import static org.junit.Assert.*;
 
@@ -30,7 +31,7 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.00)
- * @version 0.3
+ * @version 0.4
  * @module
  */
 @DependsOn({
@@ -73,4 +74,22 @@ public strictfp class LineAppenderTest e
         assertSame(f, f.append(lineSeparator + "ses illusions."));
         assertOutputEquals("Le vrai policitien, c'est celui qui arrive à garder son idéal
tout en perdant ses illusions.");
     }
+
+    /**
+     * Tests a call to {@link LineAppender#flush()} interleaved between two lines,
+     * where the second line begin with a tabulation.
+     *
+     * @throws IOException Should never happen, since we are writing in a {@link StringBuilder}.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-140">SIS-140</a>
+     */
+    @Test
+    public void testInterleavedFlush() throws IOException {
+        final LineAppender f = (LineAppender) appender;
+        f.setTabulationWidth(4);
+        f.append("S1");
+        f.flush();
+        f.append("\tS2");
+        assertOutputEquals(f.isTabulationExpanded() ? "S1  S2" : "S1\tS2");
+    }
 }

Modified: sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java [UTF-8]
(original)
+++ sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java [UTF-8]
Tue Oct 22 21:33:09 2013
@@ -22,7 +22,11 @@ import java.util.HashSet;
 import java.io.File;
 import java.net.URL;
 import java.net.URISyntaxException;
+import javax.management.JMException;
+import org.apache.sis.internal.system.Shutdown;
+import org.apache.sis.internal.system.SystemListener;
 import org.apache.sis.util.Classes;
+import org.junit.AfterClass;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
@@ -185,4 +189,21 @@ public abstract strictfp class TestSuite
             }
         }
     }
+
+    /**
+     * Simulates a module uninstall after all tests. This method will first notify any classpath-dependant
+     * services that the should clear their cache, then stop the SIS daemon threads. Those
operations are
+     * actually not needed in non-server environment (it is okay to just let the JVM stop
by itself), but
+     * the intend here is to ensure that no exception is thrown.
+     *
+     * <p>Since this method stops SIS daemon threads, the SIS library shall not be
used anymore after
+     * this method execution.</p>
+     *
+     * @throws JMException If an error occurred during unregistration of the supervisor MBean.
+     */
+    @AfterClass
+    public static void shutdown() throws JMException {
+        SystemListener.fireClasspathChanged();
+        Shutdown.stop(TestSuite.class);
+    }
 }

Modified: sis/branches/JDK6/src/main/javadoc/stylesheet.css
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/src/main/javadoc/stylesheet.css?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/src/main/javadoc/stylesheet.css (original)
+++ sis/branches/JDK6/src/main/javadoc/stylesheet.css Tue Oct 22 21:33:09 2013
@@ -56,13 +56,14 @@ table.sis tr td.sep {
 
 /*
  * Table without vertical space between rows and a little bit of space between columns.
- * This table has no border.
+ * This table has no border. Headers are still centered and other cells left-aligned.
  */
 table.compact {
   width:          auto;
   border:         none;
   border-spacing: 0pt;
   padding:        0pt;
+  line-height:    1em;
 }
 
 table.compact tr td {
@@ -127,7 +128,9 @@ ul.verbose li {
  * Overrides the <pre> definition provided by the Javadoc tools.
  */
 div.block pre {
-  font-size: 1em;
+  line-height: 1em;
+  font-size:   1em;
+  font-family: Andale Mono, Courier New, monospace;
 }
 
 

Modified: sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java?rev=1534802&r1=1534801&r2=1534802&view=diff
==============================================================================
--- sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java
[UTF-8] (original)
+++ sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java
[UTF-8] Tue Oct 22 21:33:09 2013
@@ -54,7 +54,7 @@ import org.opengis.metadata.extent.Geogr
  * Name of attributes used in the mapping from/to NetCDF metadata to ISO 19115 metadata.
  * The attributes recognized by SIS are listed below:
  *
- * <blockquote><table class="compact"><tr valign="top" width="25%"><td>
+ * <blockquote><table class="compact"><tr valign="top"><td width="25%">
  * {@value     #ACCESS_CONSTRAINT}<br>
  * {@value     #ACKNOWLEDGMENT}<br>
  * {@value     #COMMENT}<br>



Mime
View raw message