sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1684945 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/io/wkt/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/ sis-referencing/src/test/java/org/apache/sis/io/wkt/ sis-utility/src/main/java/org/apache/sis/u...
Date Thu, 11 Jun 2015 16:53:29 GMT
Author: desruisseaux
Date: Thu Jun 11 16:53:28 2015
New Revision: 1684945

URL: http://svn.apache.org/r1684945
Log:
WKT: report warnings about unknown elements.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Parser.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8]
Thu Jun 11 16:53:28 2015
@@ -281,17 +281,16 @@ final class Element {
     ////////////////////////////////////////////////////////////////////////////////////////
 
     /**
-     * Returns a {@link ParseException} for a child keyword which is either missing or unknown.
+     * Returns a {@link ParseException} for a child keyword which is unknown.
      *
-     * @param  child The missing or unknown child keyword.
-     * @return {@code true} if the given keyword is missing, or {@code false} if it is unknown.
+     * @param  child The unknown child keyword, or {@code null}.
      * @return The exception to be thrown.
      */
-    final ParseException keywordNotFound(final String child, final boolean missing) {
-        return new LocalizedParseException(locale,
-                missing ? Errors.Keys.MissingComponentInElement_2
-                        : Errors.Keys.UnknownKeywordInElement_2,
-                new String[] {keyword, child}, offset);
+    final ParseException keywordNotFound(String child) {
+        if (child == null) {
+            child = "";
+        }
+        return new LocalizedParseException(locale, Errors.Keys.UnknownKeyword_1, new String[]
{child}, offset);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
[UTF-8] Thu Jun 11 16:53:28 2015
@@ -20,6 +20,7 @@ import java.io.Console;
 import java.io.PrintWriter;
 import java.util.concurrent.atomic.AtomicReference;
 import javax.xml.bind.annotation.XmlTransient;
+import org.opengis.util.InternationalString;
 import org.apache.sis.util.Debug;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.internal.util.X364;
@@ -180,9 +181,9 @@ public abstract class FormattableObject
         try {
             formatter.append(this);
             if (strict) {
-                final String message = formatter.getErrorMessage();
+                final InternationalString message = formatter.getErrorMessage();
                 if (message != null) {
-                    throw new UnformattableObjectException(message, formatter.getErrorCause());
+                    throw new UnformattableObjectException(message.toString(), formatter.getErrorCause());
                 }
             }
             wkt = formatter.toWKT();

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] Thu Jun 11 16:53:28 2015
@@ -1487,9 +1487,15 @@ public class Formatter implements Locali
     /**
      * Returns the error message {@link #isInvalidWKT()} is set, or {@code null} otherwise.
      * If non-null, a cause may be available in the {@link #getErrorCause()} method.
+     *
+     * <div class="note"><b>Note:</b> the message is returned as an {@link
InternationalString}
+     * in order to defer the actual message formatting until needed.</div>
      */
-    final String getErrorMessage() {
-        return isInvalidWKT() ? Errors.format(Errors.Keys.CanNotRepresentInFormat_2, "WKT",
invalidElement) : null;
+    final InternationalString getErrorMessage() {
+        if (!isInvalidWKT()) {
+            return null;
+        }
+        return Errors.formatInternational(Errors.Keys.CanNotRepresentInFormat_2, "WKT", invalidElement);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/GeodeticObjectParser.java
[UTF-8] Thu Jun 11 16:53:28 2015
@@ -270,7 +270,7 @@ final class GeodeticObjectParser extends
         if (value != null) {
             return value;
         }
-        String keyword = WKTKeywords.GeogCS;
+        String keyword = null;
         final Object child = element.peek();
         if (child instanceof Element) {
             keyword = ((Element) child).keyword;
@@ -284,7 +284,7 @@ final class GeodeticObjectParser extends
                 if (keyword.equalsIgnoreCase(WKTKeywords.Datum))       return parseDatum
    (element, referencing.getGreenwich());
             }
         }
-        throw element.keywordNotFound(keyword, keyword == WKTKeywords.GeogCS);
+        throw element.keywordNotFound(keyword);
     }
 
     /**
@@ -298,7 +298,7 @@ final class GeodeticObjectParser extends
     private CoordinateReferenceSystem parseCoordinateReferenceSystem(final Element element,
final boolean mandatory)
             throws ParseException
     {
-        String keyword = WKTKeywords.GeogCS;
+        String keyword = null;
         final Object child = element.peek();
         if (child instanceof Element) {
             keyword = ((Element) child).keyword;
@@ -314,7 +314,7 @@ final class GeodeticObjectParser extends
             }
         }
         if (mandatory) {
-            throw element.keywordNotFound(keyword, keyword == WKTKeywords.GeogCS);
+            throw element.keywordNotFound(keyword);
         }
         return null;
     }
@@ -431,7 +431,7 @@ final class GeodeticObjectParser extends
                     if (extent == null) extent = new DefaultExtent();
                     extent.getTemporalElements().add(t);
                 } catch (UnsupportedOperationException e) {
-                    warning(parent, WKTKeywords.TimeExtent, e);
+                    warning(parent, element, e);
                 }
             }
         }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
[UTF-8] Thu Jun 11 16:53:28 2015
@@ -137,7 +137,7 @@ class MathTransformParser extends Parser
     final MathTransform parseMathTransform(final Element element, final boolean mandatory)
throws ParseException {
         lastMethod = null;
         classification = null;
-        String keyword = WKTKeywords.Param_MT;
+        String keyword = null;
         final Object child = element.peek();
         if (child instanceof Element) {
             keyword = ((Element) child).keyword;
@@ -149,7 +149,7 @@ class MathTransformParser extends Parser
             }
         }
         if (mandatory) {
-            throw element.keywordNotFound(keyword, keyword == WKTKeywords.Param_MT);
+            throw element.keywordNotFound(keyword);
         }
         return null;
     }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Parser.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Parser.java?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Parser.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Parser.java [UTF-8]
Thu Jun 11 16:53:28 2015
@@ -28,10 +28,13 @@ import java.text.ParsePosition;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import org.opengis.util.FactoryException;
+import org.opengis.util.InternationalString;
 import org.apache.sis.util.Workaround;
 import org.apache.sis.util.Exceptions;
 import org.apache.sis.util.resources.Errors;
+import org.apache.sis.util.resources.Vocabulary;
 import org.apache.sis.internal.metadata.WKTParser;
+import org.apache.sis.util.iso.AbstractInternationalString;
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 
@@ -103,8 +106,10 @@ abstract class Parser implements WKTPars
 
     /**
      * The first warning (other than {@link #ignoredElements}) that occurred during the parsing.
+     * Stored as an {@link InternationalString} in order to defer the actual message formatting
until needed.
+     * This is reset to {@code null} when a new parsing start.
      */
-    private String warning;
+    private InternationalString warning;
 
     /**
      * Constructs a parser using the specified set of symbols.
@@ -226,26 +231,74 @@ abstract class Parser implements WKTPars
     }
 
     /**
-     * Reports a non-fatal warning while parsing a WKT.
+     * Reports a non-fatal warning that occurred while parsing a WKT.
      *
      * @param parent  The parent element.
-     * @param keyword The keyword of the element that we can not parse.
-     * @param e The exception that occurred while parsing a WKT.
+     * @param keyword The element that we can not parse.
+     * @param ex      The non-fatal exception that occurred while parsing the element, or
{@code null} if none.
      */
-    final void warning(final Element parent, final String keyword, final Exception e) {
-        if (warning != null) {
-            warning = Errors.getResources(errorLocale).getString(Errors.Keys.UnparsableStringInElement_2,
parent.keyword, keyword);
-            final String message = Exceptions.getLocalizedMessage(e, errorLocale);
-            if (message != null) {
-                warning = warning + ' ' + message;
-            }
+    final void warning(final Element parent, final Element element, final Exception ex) {
+        if (warning == null) {
+            warning = new AbstractInternationalString() {
+                /**
+                 * Formats the error message only when requested.
+                 * In many cases, this method is never invoked.
+                 */
+                @Override
+                public String toString(final Locale locale) {
+                    CharSequence  text   = null;
+                    StringBuilder buffer = null;
+                    final Errors resources = Errors.getResources(locale);
+                    if (element != null) {  // Should be null only if 'warning' has been
invoked by 'getAndClearWarning'.
+                        text = resources.getString(Errors.Keys.UnparsableStringInElement_2,
parent.keyword, element.keyword);
+                        final String message = Exceptions.getLocalizedMessage(ex, locale);
+                        if (message != null) {
+                            text = buffer = new StringBuilder(text).append(' ').append(message);
+                        }
+                    }
+                    /*
+                     * If the parser has found some unknown elements, formats a bullet list
for them.
+                     */
+                    if (!ignoredElements.isEmpty()) {
+                        final String lineSeparator = System.lineSeparator();
+                        if (buffer == null) {
+                            buffer = new StringBuilder(250);
+                            if (text != null) {
+                                buffer.append(text).append(lineSeparator);
+                            }
+                            text = buffer;
+                        } else {
+                            buffer.append(lineSeparator);
+                        }
+                        final Vocabulary vocabulary = Vocabulary.getResources(locale);
+                        buffer.append(resources.getString(Errors.Keys.UnknownElementsInText));
+                        for (final Map.Entry<String, List<String>> entry : ignoredElements.entrySet())
{
+                            buffer.append(lineSeparator).append("  • ")
+                                    .append(vocabulary.getString(Vocabulary.Keys.Quoted_1,
entry.getKey()));
+                            String separator = vocabulary.getString(Vocabulary.Keys.InBetweenWords);
+                            for (final String p : entry.getValue()) {
+                                buffer.append(separator).append(p);
+                                separator = ", ";
+                            }
+                            buffer.append('.');
+                        }
+                    }
+                    return String.valueOf(text);
+                }
+            };
         }
     }
 
     /**
-     * Returns the warnings that occurred during the last parsing, or {@code null} if none.
+     * Returns the warning, or {@code null} if none.
+     * This method clears the warning message after the call.
      */
-    final String getWarning() {
-        return warning;
+    final InternationalString getAndClearWarning() {
+        if (warning == null && !ignoredElements.isEmpty()) {
+            warning(null, null, null);  // Force the creation of the warning object.
+        }
+        InternationalString m = warning;
+        warning = null;
+        return m;
     }
 }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/WKTFormat.java
[UTF-8] Thu Jun 11 16:53:28 2015
@@ -31,6 +31,7 @@ import java.text.ParseException;
 import javax.measure.unit.Unit;
 import javax.measure.unit.UnitFormat;
 import org.opengis.util.Factory;
+import org.opengis.util.InternationalString;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.referencing.IdentifiedObject;
 import org.apache.sis.io.CompoundFormat;
@@ -186,9 +187,12 @@ public class WKTFormat extends CompoundF
     private transient Map<Class<?>,Factory> factories;
 
     /**
-     * Whether the last operation was a parsing or formatting operation.
+     * The warning produced by the last parsing or formatting operation, or {@code null}
if none.
+     * Stored as an {@link InternationalString} in order to defer the actual message formatting
until needed.
+     *
+     * @see #getWarning()
      */
-    private transient boolean lastOperationIsParsing;
+    private transient InternationalString warning;
 
     /**
      * Creates a format for the given locale and timezone. The given locale will be used
for
@@ -506,17 +510,21 @@ public class WKTFormat extends CompoundF
     public Object parse(final CharSequence text, final ParsePosition pos) throws ParseException
{
         ArgumentChecks.ensureNonNull("text", text);
         ArgumentChecks.ensureNonNull("pos",  pos);
+        Parser parser = this.parser;
         if (parser == null) {
             if (factories == null) {
                 factories = new HashMap<>();
             }
-            parser = new GeodeticObjectParser(symbols,
+            this.parser = parser = new GeodeticObjectParser(symbols,
                     (NumberFormat) getFormat(Number.class),
                     (DateFormat)   getFormat(Date.class),
-                    convention, false, getLocale(Locale.Category.DISPLAY), factories);
+                    convention, false, getLocale(), factories);
+        }
+        try {
+            return parser.parseObject(text.toString(), pos);
+        } finally {
+            warning = parser.getAndClearWarning();
         }
-        lastOperationIsParsing = true;
-        return parser.parseObject(text.toString(), pos);
     }
 
     /**
@@ -562,14 +570,14 @@ public class WKTFormat extends CompoundF
             updateFormatter(formatter);
             this.formatter = formatter;
         }
-        formatter.clear();
-        lastOperationIsParsing = false;
         final boolean valid;
         try {
             formatter.setBuffer(buffer);
             valid = formatter.appendElement(object) || formatter.appendValue(object);
         } finally {
+            warning = formatter.getErrorMessage();  // Must be saved before formatter.clear()
is invoked.
             formatter.setBuffer(null);
+            formatter.clear();
         }
         if (!valid) {
             throw new ClassCastException(Errors.format(
@@ -610,11 +618,7 @@ public class WKTFormat extends CompoundF
      * @return The last warning, or {@code null} if none.
      */
     public String getWarning() {
-        if (lastOperationIsParsing) {
-            return (parser != null) ? parser.getWarning() : null;
-        } else {
-            return (formatter != null) ? formatter.getErrorMessage() : null;
-        }
+        return (warning != null) ? warning.toString(getLocale()) : null;
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
[UTF-8] Thu Jun 11 16:53:28 2015
@@ -149,7 +149,7 @@ public class DefaultIdentifier extends I
      *   <li>A {@linkplain org.apache.sis.metadata.iso.citation.DefaultCitation#getIdentifiers()
citation identifier}
      *       which is a valid
      *       {@linkplain org.apache.sis.util.CharSequences#isUnicodeIdentifier(CharSequence)
unicode identifier}.</li>
-     *   <li>Only if the citation had no identifier, a citation title or
+     *   <li>Only if the citation has no identifier, a citation title or
      *       {@linkplain org.apache.sis.metadata.iso.citation.DefaultCitation#getAlternateTitles()
alternate title}
      *       which is a valid
      *       {@linkplain org.apache.sis.util.CharSequences#isUnicodeIdentifier(CharSequence)
unicode identifier}.</li>

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
[UTF-8] Thu Jun 11 16:53:28 2015
@@ -18,12 +18,14 @@ package org.apache.sis.io.wkt;
 
 import java.util.Date;
 import java.util.Iterator;
+import java.util.Locale;
 import java.text.ParsePosition;
 import java.text.ParseException;
 import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
 import javax.measure.unit.Unit;
 import javax.measure.quantity.Length;
+import org.opengis.util.InternationalString;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.cs.*;
 import org.opengis.referencing.crs.*;
@@ -78,6 +80,8 @@ public final strictfp class GeodeticObje
         final Object obj = parser.parseObject(text, position);
         assertEquals("errorIndex", -1, position.getErrorIndex());
         assertEquals("index", text.length(), position.getIndex());
+        assertNull("warning", parser.getAndClearWarning());
+        assertTrue("ignoredElements", parser.ignoredElements.isEmpty());
         assertInstanceOf("GeodeticObjectParser.parseObject", type, obj);
         return type.cast(obj);
     }
@@ -620,4 +624,30 @@ public final strictfp class GeodeticObje
         assertEquals("false_easting",      600000.0, param.parameter("false_easting"    
).doubleValue(SI   .METRE),        STRICT);
         assertEquals("false_northing",     200000.0, param.parameter("false_northing"   
).doubleValue(SI   .METRE),        STRICT);
     }
+
+    /**
+     * Tests the production of a warning message when the WKT contains unknown elements.
+     *
+     * @throws ParseException if the parsing failed.
+     */
+    @Test
+    @DependsOnMethod("testWithImplicitAxes")
+    public void testWarningMessage() throws ParseException {
+        parser = new GeodeticObjectParser();
+        final ParsePosition position = new ParsePosition(0);
+        verifyGeographicCRS(0, (GeographicCRS) parser.parseObject(
+               "  GEOGCS[“WGS 84”,\n" +
+               "    DATUM[“World Geodetic System 1984”,\n" +
+               "      SPHEROID[“WGS84”, 6378137.0, 298.257223563, Ext1[“foo”], Ext2[“bla”]]],\n"
+
+               "      PRIMEM[“Greenwich”, 0.0, Intruder[“unknown”]],\n" +
+               "    UNIT[“degree”, 0.017453292519943295], Intruder[“foo”]]", position));
+
+        assertEquals("errorIndex", -1, position.getErrorIndex());
+        final InternationalString warning = parser.getAndClearWarning();
+        assertNotNull("warning", warning);
+        assertMultilinesEquals("The text contains unknown elements:\n" +
+                               "  • “Intruder” in PRIMEM, GEOGCS.\n" +
+                               "  • “Ext1” in SPHEROID.\n" +
+                               "  • “Ext2” in SPHEROID.", warning.toString(Locale.ENGLISH));
+    }
 }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] Thu Jun 11 16:53:28 2015
@@ -911,6 +911,11 @@ public final class Errors extends Indexe
         public static final short UnknownCommand_1 = 113;
 
         /**
+         * The text contains unknown elements:
+         */
+        public static final short UnknownElementsInText = 193;
+
+        /**
          * “{1}” is not a known or supported value for the ‘{0}’ enumeration.
          */
         public static final short UnknownEnumValue_2 = 114;
@@ -921,9 +926,9 @@ public final class Errors extends Indexe
         public static final short UnknownFormatFor_1 = 115;
 
         /**
-         * Keyword “{1}” in element “{0}” is unknown.
+         * Keyword “{0}” is unknown.
          */
-        public static final short UnknownKeywordInElement_2 = 192;
+        public static final short UnknownKeyword_1 = 192;
 
         /**
          * Option “{0}” is not recognized.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
[ISO-8859-1] Thu Jun 11 16:53:28 2015
@@ -193,9 +193,10 @@ UnitlessParameter_1               = Para
 UnknownAuthority_1                = Authority \u201c{0}\u201d is unknown.
 UnknownAxisDirection_1            = Axis direction \u201c{0}\u201d is unknown.
 UnknownCommand_1                  = Command \u201c{0}\u201d is not recognized.
+UnknownElementsInText             = The text contains unknown elements:
 UnknownEnumValue_2                = \u201c{1}\u201d is not a known or supported value for
the \u2018{0}\u2019 enumeration.
 UnknownFormatFor_1                = Format of \u201c{0}\u201d is not recognized.
-UnknownKeywordInElement_2         = Keyword \u201c{1}\u201d in element \u201c{0}\u201d is
unknown.
+UnknownKeyword_1                  = Keyword \u201c{0}\u201d is unknown.
 UnknownOption_1                   = Option \u201c{0}\u201d is not recognized.
 UnknownType_1                     = Type \u2018{0}\u2019 is unknown in this context.
 UnknownTypeForProperty_1          = Type of the \u201c{0}\u201d property is unknown.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
[ISO-8859-1] Thu Jun 11 16:53:28 2015
@@ -14,6 +14,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+
+#
+# Punctuation rules in French (source: http://unicode.org/udhr/n/notes_fra.html)
+#
+#   U+202F NARROW NO-BREAK SPACE  before  ; ! and ?
+#   U+00A0 NO-BREAK SPACE         before  :
+#
 AbstractType_1                    = Le type \u2018{0}\u2019 est abstrait.
 AmbiguousName_3                   = Le nom \u00ab\u202f{2}\u202f\u00bb est ambigu\u00eb car
il peut \u00eatre interpr\u00e9t\u00e9 comme \u00ab\u202f{0}\u202f\u00bb ou \u00ab\u202f{1}\u202f\u00bb.
 CanNotAddToExclusiveSet_2         = Aucun \u00e9l\u00e9ment ne peut \u00eatre ajout\u00e9
\u00e0 cet ensemble car les propri\u00e9t\u00e9s \u2018{0}\u2019 et \u2018{1}\u2019 sont mutuellement
exclusives.
@@ -182,9 +189,10 @@ UnitlessParameter_1               = Le p
 UnknownAuthority_1                = L\u2019autorit\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019est
pas reconnue.
 UnknownAxisDirection_1            = La direction d\u2019axe \u00ab\u202f{0}\u202f\u00bb n\u2019est
pas reconnue.
 UnknownCommand_1                  = La commande \u00ab\u202f{0}\u202f\u00bb n\u2019est pas
reconnue.
+UnknownElementsInText             = Le texte contient des \u00e9l\u00e9ments inconnus\u00a0:
 UnknownEnumValue_2                = \u00ab\u202f{1}\u202f\u00bb n\u2019est pas une valeur
connue ou support\u00e9e pour l\u2019\u00e9num\u00e9ration \u2018{0}\u2019.
 UnknownFormatFor_1                = Le format de \u00ab\u202f{0}\u202f\u00bb n\u2019est pas
reconnu.
-UnknownKeywordInElement_2         = Le mot-cl\u00e9 \u00ab\u202f{1}\u202f\u00bb dans l\u2019\u00e9l\u00e9ment
\u00ab\u202f{0}\u202f\u00bb n\u2019est pas reconnu.
+UnknownKeyword_1                  = Le mot-cl\u00e9 \u00ab\u202f{0}\u202f\u00bb n\u2019est
pas reconnu.
 UnknownOption_1                   = L\u2019option \u00ab\u202f{0}\u202f\u00bb n\u2019est
pas reconnue.
 UnknownType_1                     = Le type \u2018{0}\u2019 n\u2019est pas reconnu dans ce
contexte.
 UnknownTypeForProperty_1          = Le type de la propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb
est inconnu.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
[ISO-8859-1] Thu Jun 11 16:53:28 2015
@@ -14,6 +14,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+
+#
+# Punctuation rules in French (source: http://unicode.org/udhr/n/notes_fra.html)
+#
+#   U+202F NARROW NO-BREAK SPACE  before  ; ! and ?
+#   U+00A0 NO-BREAK SPACE         before  :
+#
 AlreadyRegistered_2             = Le {0} \u00ab\u202f{1}\u202f\u00bb est d\u00e9j\u00e0 inscrit
dans le registre. La seconde instance sera ignor\u00e9e.
 ChangedContainerCapacity_2      = Changement de la capacit\u00e9 du conteneur de {0} vers
{1} \u00e9l\u00e9ments.
 ConformanceMeansDatumShift      = Ce r\u00e9sultat indique si un changement de r\u00e9f\u00e9rentiel
a \u00e9t\u00e9 appliqu\u00e9.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
[UTF-8] Thu Jun 11 16:53:28 2015
@@ -211,6 +211,11 @@ public final class Vocabulary extends In
         public static final short Implementation = 21;
 
         /**
+         *  in 
+         */
+        public static final short InBetweenWords = 87;
+
+        /**
          * Index
          */
         public static final short Index = 22;
@@ -351,6 +356,11 @@ public final class Vocabulary extends In
         public static final short Paths = 46;
 
         /**
+         * “{0}”
+         */
+        public static final short Quoted_1 = 86;
+
+        /**
          * Root
          */
         public static final short Root = 47;

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
[ISO-8859-1] Thu Jun 11 16:53:28 2015
@@ -45,6 +45,7 @@ EllipsoidalHeight       = Ellipsoidal he
 Height                  = Height
 Identifier              = Identifier
 Implementation          = Implementation
+InBetweenWords          = \u2002in\u2002
 Index                   = Index
 JavaExtensions          = Java extensions
 JavaHome                = Java home directory
@@ -73,6 +74,7 @@ Options                 = Options
 Others                  = Others
 OtherSurface            = Other surface
 Paths                   = Paths
+Quoted_1                = \u201c{0}\u201d
 Root                    = Root
 RootMeanSquare          = Root Mean Square
 Scale                   = Scale

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties?rev=1684945&r1=1684944&r2=1684945&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
[ISO-8859-1] Thu Jun 11 16:53:28 2015
@@ -14,6 +14,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+
+#
+# Punctuation rules in French (source: http://unicode.org/udhr/n/notes_fra.html)
+#
+#   U+202F NARROW NO-BREAK SPACE  before  ; ! and ?
+#   U+00A0 NO-BREAK SPACE         before  :
+#
 Aliases                 = Alias
 Angle                   = Angle
 AngularDegrees          = Degr\u00e9s
@@ -45,6 +52,7 @@ EllipsoidalHeight       = Hauteur ellips
 Height                  = Hauteur
 Identifier              = Identifiant
 Implementation          = Impl\u00e9mentation
+InBetweenWords          = \u2002dans\u2002
 Index                   = Index
 JavaExtensions          = Extensions du Java
 JavaHome                = R\u00e9pertoire du Java
@@ -73,6 +81,7 @@ Options                 = Options
 Others                  = Autres
 OtherSurface            = Autre surface
 Paths                   = Chemins
+Quoted_1                = \u00ab\u202f{0}\u202f\u00bb
 Root                    = Racine
 RootMeanSquare          = Moyenne quadratique
 Scale                   = \u00c9chelle



Mime
View raw message