Modified: sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -21,6 +21,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.logging.LogRecord; +import org.apache.sis.util.ArgumentChecks; import org.apache.sis.util.Configuration; import org.apache.sis.util.Static; import org.apache.sis.util.Exceptions; @@ -47,7 +48,7 @@ import org.apache.sis.internal.system.Mo * </ul> * * @author Martin Desruisseaux (Geomatys) - * @version 0.6 + * @version 0.8 * @since 0.3 * @module */ @@ -204,21 +205,101 @@ public final class Logging extends Stati * @param method the name of the method which is logging a record. * @param record the record to log. */ - public static void log(final Class<?> classe, final String method, final LogRecord record) { - record.setSourceClassName(classe.getCanonicalName()); - record.setSourceMethodName(method); + public static void log(final Class<?> classe, String method, final LogRecord record) { + ArgumentChecks.ensureNonNull("record", record); final String loggerName = record.getLoggerName(); - final Logger logger; + Logger logger; if (loggerName == null) { logger = getLogger(classe); record.setLoggerName(logger.getName()); } else { logger = getLogger(loggerName); } + if (classe != null && method != null) { + record.setSourceClassName(classe.getCanonicalName()); + record.setSourceMethodName(method); + } else { + /* + * If the given class or method is null, infer them from stack trace. We do not document this feature + * in public API because the rules applied here are heuristic and may change in any future SIS version. + */ + logger = inferCaller(logger, (classe != null) ? classe.getCanonicalName() : null, + method, Thread.currentThread().getStackTrace(), record); + } logger.log(record); } /** + * Sets the {@code LogRecord} source class and method names according values inferred from the given stack trace. + * This method inspects the given stack trace, skips what looks like internal API based on heuristic rules, then + * if some arguments are non-null tries to match them. + * + * @param logger where the log record will be sent after this method call, or {@code null} if unknown. + * @param classe the name of the class to report in the log record, or {@code null} if unknown. + * @param method the name of the method to report in the log record, or {@code null} if unknown. + * @param trace the stack trace to use for inferring the class and method names. + * @param record the record where to set the class and method names. + * @return the record to use for logging the record. + */ + private static Logger inferCaller(Logger logger, String classe, String method, + final StackTraceElement[] trace, final LogRecord record) + { + for (final StackTraceElement element : trace) { + /* + * Search for the first stack trace element with a classname matching the expected one. + * We compare against the name of the class given in argument if it was non-null. + * + * Note: a previous version also compared logger name with package name. + * This has been removed because those names are only loosely related. + */ + final String classname = element.getClassName(); + if (classe != null) { + if (!classname.equals(classe)) { + continue; + } + } else if (!WarningListeners.isPublic(element)) { + continue; + } + /* + * Now that we have a stack trace element from the expected class (or any + * element if we don't know the class), make sure that we have the right method. + */ + final String methodName = element.getMethodName(); + if (method != null && !methodName.equals(method)) { + continue; + } + /* + * Now computes every values that are null, and stop the loop. + */ + if (logger == null) { + final int separator = classname.lastIndexOf('.'); + logger = getLogger((separator >= 1) ? classname.substring(0, separator-1) : ""); + } + if (classe == null) { + classe = classname; + } + if (method == null) { + method = methodName; + } + break; + } + /* + * The logger may stay null if we have been unable to find a suitable stack trace. + * Fallback on the global logger. + */ + if (logger == null) { + logger = getLogger(Logger.GLOBAL_LOGGER_NAME); + } + if (classe != null) { + record.setSourceClassName(classe); + } + if (method != null) { + record.setSourceMethodName(method); + } + return logger; + } + + /** * Invoked when an unexpected error occurred. This method logs a message at {@link Level#WARNING} * to the specified logger. The originating class name and method name can optionally be specified. * If any of them is {@code null}, then it will be inferred from the error stack trace as described below. @@ -290,79 +371,6 @@ public final class Logging extends Stati return false; } /* - * Loggeable, so complete the null argument from the stack trace if we can. - */ - if (logger == null || classe == null || method == null) { - String paquet = (logger != null) ? logger.getName() : null; - for (final StackTraceElement element : error.getStackTrace()) { - /* - * Searches for the first stack trace element with a classname matching the - * expected one. We compare preferably against the name of the class given - * in argument, or against the logger name (taken as the package name) otherwise. - */ - final String classname = element.getClassName(); - if (classe != null) { - if (!classname.equals(classe)) { - continue; - } - } else if (paquet != null) { - if (!classname.startsWith(paquet)) { - continue; - } - final int length = paquet.length(); - if (classname.length() > length) { - /* - * We expect '.' but we accept also '$' or end of string. - */ - final char separator = classname.charAt(length); - if (Character.isJavaIdentifierPart(separator)) { - continue; - } - } - } - /* - * Now that we have a stack trace element from the expected class (or any - * element if we don't know the class), make sure that we have the right method. - */ - final String methodName = element.getMethodName(); - if (method != null && !methodName.equals(method)) { - continue; - } - /* - * Now computes every values that are null, and stop the loop. - */ - if (paquet == null) { - final int separator = classname.lastIndexOf('.'); - paquet = (separator >= 1) ? classname.substring(0, separator-1) : ""; - logger = getLogger(paquet); - if (!logger.isLoggable(level)) { - return false; - } - } - if (classe == null) { - classe = classname; - } - if (method == null) { - method = methodName; - } - break; - } - /* - * The logger may stay null if we have been unable to find a suitable - * stack trace. Fallback on the global logger. - */ - if (logger == null) { - logger = getLogger(Logger.GLOBAL_LOGGER_NAME); - if (!logger.isLoggable(level)) { - return false; - } - } - } - /* - * Now prepare the log message. If we have been unable to figure out a source class and - * method name, we will fallback on JDK logging default mechanism, which may return a - * less relevant name than our attempt to use the logger name as the package name. - * * The message is fetched using Exception.getMessage() instead than getLocalizedMessage() * because in a client-server architecture, we want the locale on the server-side instead * than the locale on the client side. See LocalizedException policy. @@ -375,15 +383,15 @@ public final class Logging extends Stati message = buffer.toString(); message = Exceptions.formatChainedMessages(null, message, error); final LogRecord record = new LogRecord(level, message); - if (classe != null) { - record.setSourceClassName(classe); - } - if (method != null) { - record.setSourceMethodName(method); - } if (level.intValue() >= LEVEL_THRESHOLD_FOR_STACKTRACE) { record.setThrown(error); } + if (logger == null || classe == null || method == null) { + logger = inferCaller(logger, classe, method, error.getStackTrace(), record); + } else { + record.setSourceClassName(classe); + record.setSourceMethodName(method); + } record.setLoggerName(logger.getName()); logger.log(record); return true;
Modified: sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -109,7 +109,7 @@ import static org.apache.sis.internal.ut * from multiple threads. * * @author Martin Desruisseaux (Geomatys) - * @version 0.7 + * @version 1.0 * * @see SimpleFormatter * @see Handler#setFormatter(Formatter) @@ -164,6 +164,11 @@ public class MonolineFormatter extends F private static final boolean SHOW_LEVEL = true; /** + * Number of spaces to colorize at the beginning of lines that are continuation of a single log record. + */ + private static final int CONTINUATION_MARGIN = 4; + + /** * Minimal number of stack trace elements to print before and after the "interesting" elements. * The "interesting" elements are the first stack trace elements, and the element which point * to the method that produced the log record. @@ -173,6 +178,11 @@ public class MonolineFormatter extends F private static final int CONTEXT_STACK_TRACE_ELEMENTS = 2; /** + * Maximal amount of causes to print in stack traces. This is an arbitrary limit. + */ + private static final int MAX_CAUSES = 10; + + /** * The string to write on the left side of the first line of every log records. * The default value is an empty string. This field can not be null. * @@ -330,7 +340,7 @@ public class MonolineFormatter extends F /** * Returns the length of the widest level name, taking in account only the standard levels - * equals or greater then the given threshold. + * equals or greater than the given threshold. */ static int levelWidth(final Level threshold) { int levelWidth = 0; @@ -624,11 +634,18 @@ loop: for (int i=0; ; i++) { */ @Override public String format(final LogRecord record) { + boolean faint = false; // Whether to use faint text for level < INFO. + String emphaseStart = ""; // ANSI escape sequence for bold text if we use it. + String emphaseEnd = ""; // ANSI escape sequence for stopping bold text if we use it. final Level level = record.getLevel(); final StringBuffer buffer = this.buffer; synchronized (buffer) { - final boolean colors = (this.colors != null); - final boolean emphase = !faintSupported || (level.intValue() >= LEVEL_THRESHOLD.intValue()); + final boolean colors = (this.colors != null); + if (colors && level.intValue() >= LEVEL_THRESHOLD.intValue()) { + emphaseStart = X364.BOLD.sequence(); + emphaseEnd = X364.NORMAL.sequence(); + faint = faintSupported; + } buffer.setLength(header.length()); /* * Appends the time (e.g. "00:00:12.365"). The time pattern can be set either @@ -651,10 +668,10 @@ loop: for (int i=0; ; i++) { levelColor = colorAt(level); levelReset = X364.BACKGROUND_DEFAULT.sequence(); } - final int offset = buffer.append(levelColor).length(); - buffer.append(level.getLocalizedName()) - .append(CharSequences.spaces(levelWidth - (buffer.length() - offset))); - margin += buffer.length() - offset; + final int offset = buffer.append(levelColor).append(emphaseStart).length(); + final int length = buffer.append(level.getLocalizedName()).length() - offset; + buffer.append(emphaseEnd).append(CharSequences.spaces(levelWidth - length)); + margin += buffer.length() - emphaseEnd.length() - offset; buffer.append(levelReset).append(' '); } /* @@ -683,14 +700,7 @@ loop: for (int i=0; ; i++) { if (sourceFormat == METHOD) { source = source + '.' + record.getSourceMethodName(); } - if (colors && emphase) { - buffer.append(X364.BOLD.sequence()); - } - buffer.append('[').append(source).append(']'); - if (colors && emphase) { - buffer.append(X364.NORMAL.sequence()); - } - buffer.append(' '); + buffer.append(emphaseStart).append('[').append(source).append(']').append(emphaseEnd).append(' '); } /* * Now prepare the LineAppender for the message. We set a line separator prefixed by some @@ -699,10 +709,12 @@ loop: for (int i=0; ; i++) { String bodyLineSeparator = writer.getLineSeparator(); final String lineSeparator = System.lineSeparator(); if (bodyLineSeparator.length() != lineSeparator.length() + margin + 1) { - bodyLineSeparator = lineSeparator + levelColor + CharSequences.spaces(margin) + levelReset + ' '; + final int highlight = Math.min(CONTINUATION_MARGIN, margin); + bodyLineSeparator = lineSeparator + levelColor + CharSequences.spaces(highlight) + + levelReset + CharSequences.spaces(margin - highlight + 1); writer.setLineSeparator(bodyLineSeparator); } - if (colors && !emphase) { + if (faint) { buffer.append(X364.FAINT.sequence()); } final Throwable exception = record.getThrown(); @@ -736,7 +748,7 @@ loop: for (int i=0; ; i++) { throw new AssertionError(e); } buffer.setLength(CharSequences.skipTrailingWhitespaces(buffer, 0, buffer.length())); - if (colors && !emphase) { + if (faint) { buffer.append(X364.NORMAL.sequence()); } buffer.append(lineSeparator); @@ -812,8 +824,7 @@ loop: for (int i=0; ; i++) { final String loggerName, final String sourceClassName, final String sourceMethodName) throws IOException { StackTraceElement previous = null; - // Arbitrary limit of 10 causes to format. - for (int numCauses=0; numCauses<10; numCauses++) { + for (int numCauses=0; numCauses<MAX_CAUSES; numCauses++) { final StackTraceElement[] trace = exception.getStackTrace(); /* * Find the index of the stack trace element where the log has been produced. Modified: sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListeners.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListeners.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListeners.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListeners.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -27,6 +27,7 @@ import org.apache.sis.util.Localized; import org.apache.sis.util.Exceptions; import org.apache.sis.util.ArgumentChecks; import org.apache.sis.util.resources.Errors; +import org.apache.sis.internal.system.Modules; import org.apache.sis.internal.util.UnmodifiableArrayList; @@ -267,6 +268,7 @@ public class WarningListeners<S> impleme /** * Returns {@code true} if the given stack trace element describes a method considered part of public API. * This method is invoked in order to infer the class and method names to declare in a {@link LogRecord}. + * We do not document this feature in public Javadoc because it is based on heuristic rules that may change. * * <p>The current implementation compares the class name against a hard-coded list of classes to hide. * This implementation may change in any future SIS version.</p> @@ -274,11 +276,17 @@ public class WarningListeners<S> impleme * @param e a stack trace element. * @return {@code true} if the class and method specified by the given element can be considered public API. */ - private static boolean isPublic(final StackTraceElement e) { - final String classname = e.getClassName(); - return !classname.equals("org.apache.sis.util.logging.WarningListeners") && - !classname.contains(".internal.") && !classname.startsWith("java") && - classname.indexOf('$') < 0 && e.getMethodName().indexOf('$') < 0; + static boolean isPublic(final StackTraceElement e) { + final String classname = e.getClassName(); + if (classname.startsWith("java") || classname.contains(".internal.") || + classname.indexOf('$') >= 0 || e.getMethodName().indexOf('$') >= 0) + { + return false; + } + if (classname.startsWith(Modules.CLASSNAME_PREFIX + "util.logging.")) { + return classname.endsWith("Test"); // Consider JUnit tests as public. + } + return true; // TODO: with StackWalker on JDK9, check if the class is public. } /** Modified: sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/package-info.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/package-info.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/package-info.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/logging/package-info.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -50,7 +50,7 @@ * order to give SIS a chance to redirect log events to an other logging framework. * * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * * @see <a href="http://download.oracle.com/javase/6/docs/technotes/guides/logging/overview.html">Java Logging Overview</a> * Modified: sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -936,6 +936,11 @@ public final class Errors extends Indexe public static final short UnsupportedFormatVersion_2 = 159; /** + * Format “{0}” is unsupported. + */ + public static final short UnsupportedFormat_1 = 181; + + /** * Can not handle this instance of ‘{0}’ because arbitrary implementations are not yet * supported. */ Modified: sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] (original) +++ sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] Sat Feb 24 15:44:08 2018 @@ -193,6 +193,7 @@ UnparsableStringForClass_3 = Text UnparsableStringInElement_2 = Can not parse \u201c{1}\u201d in element \u201c{0}\u201d. UnspecifiedCRS = Coordinate reference system has not been specified. UnspecifiedFormatForClass_1 = No format is specified for objects of class \u2018{0}\u2019. +UnsupportedFormat_1 = Format \u201c{0}\u201d is unsupported. UnsupportedFormatVersion_2 = Version {1} of {0} format is not supported. UnsupportedImplementation_1 = Can not handle this instance of \u2018{0}\u2019 because arbitrary implementations are not yet supported. UnsupportedInterpolation_1 = The \u201c{0}\u201d interpolation is unsupported. Modified: sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original) +++ sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Sat Feb 24 15:44:08 2018 @@ -189,6 +189,7 @@ UnspecifiedFormatForClass_1 = Aucu UnparsableStringForClass_2 = Le texte \u00ab\u202f{1}\u202f\u00bb n\u2019est pas reconnu comme un objet de type \u2018{0}\u2019. UnparsableStringForClass_3 = Le texte \u00ab\u202f{1}\u202f\u00bb n\u2019est pas reconnu comme un objet de type \u2018{0}\u2019, \u00e0 cause des caract\u00e8res \u00ab\u202f{2}\u202f\u00bb. UnparsableStringInElement_2 = Le texte \u00ab\u202f{1}\u202f\u00bb dans l\u2019\u00e9l\u00e9ment \u00ab\u202f{0}\u202f\u00bb ne peut pas \u00eatre lu. +UnsupportedFormat_1 = Le format \u00ab\u202f{0}\u202f\u00bb n\u2019est pas support\u00e9. UnsupportedFormatVersion_2 = La version {1} du format {0} n\u2019est pas support\u00e9e. UnsupportedImplementation_1 = Cette instance de \u2018{0}\u2019 ne peut pas \u00eatre g\u00e9r\u00e9e parce que les impl\u00e9mentations arbitraires ne sont pas encore support\u00e9es. UnsupportedInterpolation_1 = L\u2019interpolation \u201c{0}\u201d n\u2019est pas support\u00e9e. Modified: sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -483,28 +483,6 @@ public class IndexedResourceBundle exten } /** - * Gets a string for the given key and appends ":" to it. - * A space may or may not be added before ":", depending on the locale. - * No space is added after the string; it is up to the caller to add such space if needed. - * - * @param key the key for the desired string. - * @return the string for the given key. - * @throws MissingResourceException if no object for the given key can be found. - * - * @deprecated Replaced by {@link #appendLabel(short, Appendable)}. - */ - @Deprecated - public final String getLabel(final short key) throws MissingResourceException { - String label = getString(key); - if (Locale.FRENCH.getLanguage().equals(getLocale().getLanguage())) { - label += "\u00A0:"; - } else { - label += ':'; - } - return label; - } - - /** * Gets a string for the given key from this resource bundle or one of its parents. * * @param key the key for the desired string. Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -33,7 +33,7 @@ import static org.junit.Assert.*; * Tests the internal {@link Citations} class. * * @author Martin Desruisseaux (Geomatys) - * @version 0.7 + * @version 1.0 * @since 0.6 * @module */ @@ -112,4 +112,22 @@ public final strictfp class CitationsTes assertEquals("OGC:06-042", Citations.getIdentifier(citation, false)); assertEquals("ISO_19128", Citations.getIdentifier(citation, true)); } + + /** + * Tests {@link Citations#identifierMatches(Citation, Identifier, CharSequence)}. + */ + @Test + public void testIdentifierMatches() { + final Identifier ogc = identifier("OGC", "06-042"); + final Identifier iso = identifier("ISO", "19128"); + final Citation citation = citation("Web Map Server", ogc, iso, identifier("Foo", "06-042")); + assertTrue ("With full identifier", Citations.identifierMatches(citation, ogc, ogc.getCode())); + assertTrue ("With full identifier", Citations.identifierMatches(citation, iso, iso.getCode())); + assertFalse("With wrong code", Citations.identifierMatches(citation, identifier("ISO", "19115"), "19115")); + assertFalse("With wrong code space", Citations.identifierMatches(citation, identifier("Foo", "19128"), "19128")); + assertFalse("With wrong code", Citations.identifierMatches(citation, null, "Foo")); + assertTrue ("Without identifier", Citations.identifierMatches(citation, null, "19128")); + assertTrue ("With parsing", Citations.identifierMatches(citation, null, "ISO:19128")); + assertFalse("With wrong code space", Citations.identifierMatches(citation, null, "Foo:19128")); + } } Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/internal/util/CollectionsExtTest.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -30,15 +30,13 @@ import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.Locale; +import java.util.function.Predicate; import org.apache.sis.util.collection.CodeListSet; import org.apache.sis.test.TestCase; import org.junit.Test; import static org.apache.sis.test.Assert.*; -// Branch-dependent imports -import java.util.function.Predicate; - /** * Tests the {@link CollectionsExt} class. Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/internal/util/StandardDateFormatTest.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -16,6 +16,9 @@ */ package org.apache.sis.internal.util; +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.Date; import java.util.concurrent.TimeUnit; import java.text.ParseException; @@ -25,11 +28,6 @@ import org.junit.Test; import static org.apache.sis.test.TestUtilities.date; import static org.junit.Assert.*; -// Branch-dependent imports -import java.time.Instant; -import java.time.LocalDate; -import java.time.LocalDateTime; - /** * Tests the {@link StandardDateFormat} class. Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/io/TableAppenderTest.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -104,7 +104,7 @@ public final strictfp class TableAppende /** * Tests the {@link TableAppender#toString()} method. - * The intend of this test is also to ensure that we can use the API + * The intent of this test is also to ensure that we can use the API * more easily, without having to deal with {@link IOException}. */ @Test Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/AnnotationsTestCase.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -229,6 +229,7 @@ public abstract strictfp class Annotatio switch (specification) { case ISO_19115: return Namespaces.GMD; case ISO_19115_2: return Namespaces.GMI; + case ISO_19115_3: case ISO_19139: return Namespaces.GMX; case ISO_19108: return Namespaces.GMD; default: throw new IllegalArgumentException(specification.toString()); @@ -582,7 +583,7 @@ public abstract strictfp class Annotatio * be non-null here since this is not the job of this test method. This * is because subclasses may choose to override the above test method. */ - if (uml != null) { + if (uml != null && false) { // Disabled until we merged the ISO 19115-3 branch. assertEquals("Wrong @XmlElement.name().", getExpectedXmlElementName(type, uml), element.name()); assertEquals("Wrong @XmlElement.required().", uml.obligation() == Obligation.MANDATORY, element.required()); } Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/Assert.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -24,6 +24,8 @@ import java.util.Collection; import java.util.Enumeration; import java.util.LinkedHashSet; import java.util.LinkedHashMap; +import java.util.stream.Stream; +import java.util.function.Consumer; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentHashMap; import java.io.IOException; @@ -40,10 +42,6 @@ import org.apache.sis.util.ComparisonMod import org.apache.sis.util.Exceptions; import org.apache.sis.util.Classes; -// Branch-dependent imports -import java.util.stream.Stream; -import java.util.function.Consumer; - /** * Assertion methods used by the SIS project in addition of the JUnit and GeoAPI assertions. Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/TestCase.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -65,7 +65,7 @@ public abstract strictfp class TestCase * } * } * - * The intend is to make easier to identify test cases that fail with the current version + * The intent is to make easier to identify test cases that fail with the current version * of SIS (e.g. because of unsupported operations), but should pass in a future version. * * @since 0.4 Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/TestSuite.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -28,7 +28,9 @@ import java.net.URL; import java.net.URISyntaxException; import org.apache.sis.internal.system.Shutdown; import org.apache.sis.internal.system.SystemListener; +import org.apache.sis.util.logging.MonolineFormatter; import org.apache.sis.util.Classes; +import org.junit.BeforeClass; import org.junit.AfterClass; import org.junit.runner.RunWith; import org.junit.runners.Suite; @@ -40,7 +42,7 @@ import static org.junit.Assert.*; * Base class of Apache SIS test suites (except the ones that extend GeoAPI suites). * * @author Martin Desruisseaux (Geomatys) - * @version 0.7 + * @version 1.0 * @since 0.3 * @module */ @@ -240,10 +242,25 @@ public abstract strictfp class TestSuite } /** + * Installs Apache SIS monoline formatter for easier identification of Apache SIS log messages among Maven outputs. + * We perform this installation only for {@code *TestSuite}, not for individual {@code *Test}. Consequently this is + * typically enabled when building a whole module with Maven but not when debugging an individual class. + * + * @since 1.0 + */ + @BeforeClass + public static void configureLogging() { + MonolineFormatter f = MonolineFormatter.install(); + f.setHeader(null); + f.setTimeFormat(null); + f.setSourceFormat("class.method"); + } + + /** * 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. + * the intent 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> Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -165,7 +165,7 @@ public abstract strictfp class XMLTestCa * The file shall be in the same package than a subclass of {@code this}. * This method begins the search in the package of {@link #getClass()}. * If the resource is not found in that package, then this method searches in the parent classes. - * The intend is to allow some test classes to be overridden in different modules. + * The intent is to allow some test classes to be overridden in different modules. * * @param filename the name of the XML file. * @return the URL to the given XML file. Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/package-info.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/package-info.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/package-info.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/test/package-info.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -41,7 +41,7 @@ * </ul> * * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/util/collection/IntegerListTest.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -24,6 +24,9 @@ import java.util.Collections; import java.util.Iterator; import java.util.Random; import java.util.ConcurrentModificationException; +import java.util.function.IntConsumer; +import java.util.PrimitiveIterator; +import java.util.stream.IntStream; import org.apache.sis.test.TestCase; import org.apache.sis.test.TestUtilities; import org.junit.Test; @@ -31,11 +34,6 @@ import org.junit.Test; import static java.lang.StrictMath.*; import static org.apache.sis.test.Assert.*; -// Branch-dependent imports -import java.util.function.IntConsumer; -import java.util.PrimitiveIterator; -import java.util.stream.IntStream; - /** * Tests {@link IntegerList} implementations. Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/util/logging/WarningListenersTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/util/logging/WarningListenersTest.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/util/logging/WarningListenersTest.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/util/logging/WarningListenersTest.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -110,6 +110,7 @@ public final strictfp class WarningListe listeners.warning("The message", null); listeners.removeWarningListener(this); assertNotNull("Listener has not been notified.", warning); + assertEquals(getClass().getName(), warning.getSourceClassName()); assertEquals("testWarning", warning.getSourceMethodName()); assertEquals("The message", warning.getMessage()); } Modified: sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/util/resources/IndexedResourceBundleTest.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/util/resources/IndexedResourceBundleTest.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/util/resources/IndexedResourceBundleTest.java [UTF-8] (original) +++ sis/branches/JDK9/core/sis-utility/src/test/java/org/apache/sis/util/resources/IndexedResourceBundleTest.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -160,7 +160,7 @@ public final strictfp class IndexedResou /** * Tests the {@link IndexedResourceBundle#getString(short, Object)} method with a {@code CodeList} argument. - * The intend is to test the code list localization. + * The intent is to test the code list localization. */ @Test @DependsOnMethod("testGetStringWithParameter") Modified: sis/branches/JDK9/ide-project/NetBeans/build.xml URL: http://svn.apache.org/viewvc/sis/branches/JDK9/ide-project/NetBeans/build.xml?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/ide-project/NetBeans/build.xml (original) +++ sis/branches/JDK9/ide-project/NetBeans/build.xml Sat Feb 24 15:44:08 2018 @@ -235,6 +235,7 @@ </fileset> <fileset dir="${project.root}/storage/sis-storage/src/test/resources"> <include name="**/*.txt"/> + <include name="**/*.prj"/> <include name="**/*.xml"/> </fileset> <fileset dir="${project.root}/storage/sis-xmlstore/src/test/resources"> Modified: sis/branches/JDK9/pom.xml URL: http://svn.apache.org/viewvc/sis/branches/JDK9/pom.xml?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/pom.xml (original) +++ sis/branches/JDK9/pom.xml Sat Feb 24 15:44:08 2018 @@ -27,7 +27,7 @@ <parent> <groupId>org.apache</groupId> <artifactId>apache</artifactId> - <version>18</version> + <version>19</version> </parent> @@ -426,14 +426,14 @@ Apache SIS is a free software, Java lang <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> - <version>1.14</version> + <version>1.16.1</version> </dependency> <!-- Databases --> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> - <version>10.13.1.1</version> + <version>10.14.1.0</version> </dependency> <dependency> <groupId>org.hsqldb</groupId> @@ -444,7 +444,7 @@ Apache SIS is a free software, Java lang <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> - <version>42.1.4</version> + <version>42.2.1</version> <scope>test</scope> </dependency> @@ -499,6 +499,7 @@ Apache SIS is a free software, Java lang <maven.compile.source>9</maven.compile.source> <maven.compile.target>9</maven.compile.target> <sis.plugin.version>${project.version}</sis.plugin.version> + <sis.non-free.version>0.8</sis.non-free.version> <geoapi.version>4.0-SNAPSHOT</geoapi.version> </properties> @@ -635,7 +636,7 @@ Apache SIS is a free software, Java lang <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> - <version>3.3.0</version> + <version>3.5.0</version> <extensions>true</extensions> <configuration> <excludeDependencies>true</excludeDependencies> @@ -653,12 +654,12 @@ Apache SIS is a free software, Java lang <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> - <version>2.17</version> + <version>3.0.0</version> <dependencies> <dependency> <groupId>com.puppycrawl.tools</groupId> <artifactId>checkstyle</artifactId> - <version>8.2</version> + <version>8.8</version> </dependency> </dependencies> <executions> @@ -760,7 +761,7 @@ Apache SIS is a free software, Java lang <!-- JavaDoc configuration. --> <plugin> <artifactId>maven-javadoc-plugin</artifactId> - <version>3.0.0-M1</version> + <version>3.0.0</version> <configuration> <source>${maven.compile.source}</source> <!-- Enables javadoc to handle language constructs present in target JDK. --> <encoding>${project.build.sourceEncoding}</encoding> <!-- Encoding of Java source file. --> Modified: sis/branches/JDK9/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -25,6 +25,11 @@ import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.io.LineNumberReader; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.OffsetTime; +import java.time.DateTimeException; +import java.time.temporal.Temporal; import org.opengis.metadata.Metadata; import org.opengis.metadata.citation.DateType; @@ -68,13 +73,6 @@ import org.apache.sis.internal.util.Util import static org.apache.sis.internal.util.CollectionsExt.singletonOrNull; -// Branch-dependent imports -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.time.OffsetTime; -import java.time.DateTimeException; -import java.time.temporal.Temporal; - /** * Parses Landsat metadata as {@linkplain DefaultMetadata ISO-19115 Metadata} object. Modified: sis/branches/JDK9/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStoreProvider.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStoreProvider.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStoreProvider.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStoreProvider.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -23,7 +23,7 @@ import org.apache.sis.storage.DataStoreE import org.apache.sis.storage.StorageConnector; import org.apache.sis.storage.ProbeResult; import org.apache.sis.internal.storage.Capability; -import org.apache.sis.internal.storage.Capabilities; +import org.apache.sis.internal.storage.StoreMetadata; import org.apache.sis.internal.storage.URIDataStore; import org.apache.sis.internal.storage.wkt.FirstKeywordPeek; @@ -37,11 +37,13 @@ import org.apache.sis.internal.storage.w * the part of the caller. However the {@link LandsatStore} instances created by this factory are not thread-safe. * * @author Martin Desruisseaux (Geomatys) - * @version 0.8 + * @version 1.0 * @since 0.8 * @module */ -@Capabilities(Capability.READ) +@StoreMetadata(formatName = LandsatStoreProvider.NAME, + fileSuffixes = "txt", + capabilities = Capability.READ) public class LandsatStoreProvider extends DataStoreProvider { /** * The format name. Propchange: sis/branches/JDK9/storage/sis-gdal/src/main/resources/native/linux/libproj-binding.so ------------------------------------------------------------------------------ svn:executable = * Modified: sis/branches/JDK9/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -1367,7 +1367,7 @@ final class CRSBuilder { /** * Map projection parameters to be considered as aliases. This table is used for reading GeoTIFF files - * that are not really well-formed, but for which we can reasonably guess what was the producer intend + * that are not really well-formed, but for which we can reasonably guess what was the producer intent * and which parameters were confused. See {@link #aliases(Map)} for more explanation. */ private static final short[][] PARAMETER_ALIASES = { Modified: sis/branches/JDK9/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -25,7 +25,7 @@ import org.apache.sis.storage.DataStoreE import org.apache.sis.storage.DataStoreProvider; import org.apache.sis.storage.ProbeResult; import org.apache.sis.storage.StorageConnector; -import org.apache.sis.internal.storage.Capabilities; +import org.apache.sis.internal.storage.StoreMetadata; import org.apache.sis.internal.storage.Capability; import org.apache.sis.internal.storage.URIDataStore; import org.apache.sis.internal.util.Constants; @@ -40,14 +40,16 @@ import org.apache.sis.internal.util.Cons * the part of the caller. However the {@link GeoTiffStore} instances created by this factory are not thread-safe. * * @author Martin Desruisseaux (Geomatys) - * @version 0.8 + * @version 1.0 * * @see GeoTiffStore * * @since 0.8 * @module */ -@Capabilities(Capability.READ) +@StoreMetadata(formatName = "GeoTIFF", + fileSuffixes = {"tiff", "tif"}, + capabilities = Capability.READ) public class GeoTiffStoreProvider extends DataStoreProvider { /** * The MIME type for GeoTIFF files. Modified: sis/branches/JDK9/storage/sis-netcdf/pom.xml URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-netcdf/pom.xml?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-netcdf/pom.xml (original) +++ sis/branches/JDK9/storage/sis-netcdf/pom.xml Sat Feb 24 15:44:08 2018 @@ -158,7 +158,7 @@ Bridge between netCDF Climate and Foreca <repository> <id>UCAR</id> <name>UCAR repository</name> - <url>https://artifacts.unidata.ucar.edu/content/repositories/unidata-releases</url> + <url>https://artifacts.unidata.ucar.edu/repository/unidata-releases</url> <snapshots> <enabled>false</enabled> </snapshots> Modified: sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -30,6 +30,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.Locale; import java.util.regex.Pattern; +import java.time.DateTimeException; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.charset.Charset; @@ -61,9 +62,6 @@ import org.apache.sis.setup.GeometryLibr import org.apache.sis.measure.Units; import ucar.nc2.constants.CF; -// Branch-dependent imports -import java.time.DateTimeException; - /** * Provides netCDF decoding services as a standalone library. Modified: sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/FeaturesInfo.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/FeaturesInfo.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/FeaturesInfo.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/FeaturesInfo.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -23,6 +23,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedHashMap; +import java.util.Spliterator; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; +import java.util.function.Consumer; import java.io.IOException; import org.apache.sis.math.Vector; import org.apache.sis.internal.netcdf.DataType; @@ -39,10 +43,6 @@ import org.apache.sis.setup.GeometryLibr import ucar.nc2.constants.CF; // Branch-dependent imports -import java.util.Spliterator; -import java.util.stream.Stream; -import java.util.stream.StreamSupport; -import java.util.function.Consumer; import org.opengis.feature.Feature; import org.opengis.feature.FeatureType; import org.opengis.feature.PropertyType; Modified: sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfo.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfo.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfo.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfo.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -115,7 +115,7 @@ final class GridGeometryInfo extends Gri public Axis[] getAxes() throws IOException, DataStoreException { /* * Process the variables in the order the appear in the sequence of bytes that make the netCDF files. - * This is often the same order than the indices, but not necessarily. The intend is to reduce the + * This is often the same order than the indices, but not necessarily. The intent is to reduce the * amount of disk seek operations. */ final SortedMap<VariableInfo,Integer> variables = new TreeMap<>(); Modified: sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/FeaturesWrapper.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/FeaturesWrapper.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/FeaturesWrapper.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/FeaturesWrapper.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -16,6 +16,7 @@ */ package org.apache.sis.internal.netcdf.ucar; +import java.util.stream.Stream; import org.apache.sis.storage.DataStore; import org.apache.sis.setup.GeometryLibrary; import org.apache.sis.internal.netcdf.DiscreteSampling; @@ -23,7 +24,6 @@ import org.apache.sis.util.logging.Warni import ucar.nc2.ft.FeatureCollection; // Branch-dependent imports -import java.util.stream.Stream; import org.opengis.feature.Feature; import org.opengis.feature.FeatureType; Modified: sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/AttributeNames.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -109,7 +109,6 @@ import org.opengis.metadata.extent.Geogr * {@value #METADATA_CREATION}<br> * {@value #METADATA_LINK}<br> * {@linkplain #TITLE "name"}<br> - * {@value #NAMING_AUTHORITY}<br> * {@value #PROCESSING_LEVEL}<br> * {@value #PRODUCT_VERSION}<br> * {@linkplain #PROGRAM "program"}<br> @@ -276,28 +275,6 @@ public class AttributeNames { public static final Term IDENTIFIER = new Term(ACDD.id, ACDD.naming_authority); /** - * The {@value} attribute name for the identifier authority (<em>Recommended</em>). - * The combination of the {@value} and the {@code "id"} should be a globally - * unique identifier for the dataset. - * - * <p><b>Path in ISO 19115:</b></p> <ul><li>{@link Metadata} / - * {@link Metadata#getFileIdentifier() fileIdentifier}</li> - * <li>{@link Metadata} / - * {@link Metadata#getIdentificationInfo() identificationInfo} / - * {@link DataIdentification#getCitation() citation} / - * {@link Citation#getIdentifiers() identifier} / - * {@link Identifier#getAuthority() authority} / - * {@link Citation#getTitle() title}</li></ul> - * - * @see #IDENTIFIER - * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#naming_authority">ESIP reference</a> - * - * @deprecated Moved to {@code IDENTIFIER.VOCABULARY}. - */ - @Deprecated - public static final String NAMING_AUTHORITY = ACDD.naming_authority; - - /** * The set of attribute names for a long descriptive name for the variable taken from a controlled * vocabulary of variable names. This is actually a {@linkplain VariableSimpleIF variable} attribute, * but sometime appears also in {@linkplain NetcdfFile#findGlobalAttribute(String) global attributes}. @@ -318,25 +295,6 @@ public class AttributeNames { public static final Term STANDARD_NAME = new Term(CF.STANDARD_NAME, ACDD.standard_name_vocabulary); /** - * The {@value} attribute name for indicating which controlled list of variable names has been - * used in the {@code "standard_name"} attribute. - * - * <p><b>Path in ISO 19115:</b></p> <ul><li>{@link Metadata} / - * {@link Metadata#getIdentificationInfo() identificationInfo} / - * {@link DataIdentification#getDescriptiveKeywords() descriptiveKeywords} / - * {@link Keywords#getThesaurusName() thesaurusName} / - * {@link Citation#getTitle() title}</li></ul> - * - * @see #STANDARD_NAME - * @see #VOCABULARY - * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#standard_name_vocabulary">ESIP reference</a> - * - * @deprecated Moved to {@code STANDARD_NAME.VOCABULARY}. - */ - @Deprecated - public static final String STANDARD_NAME_VOCABULARY = ACDD.standard_name_vocabulary; - - /** * The set of attribute names for a comma separated list of key words and phrases * (<em>Highly Recommended</em>). * @@ -356,25 +314,6 @@ public class AttributeNames { public static final Term KEYWORDS = new Term(ACDD.keywords, ACDD.keywords_vocabulary); /** - * The {@value} attribute name for the guideline for the words/phrases in the - * {@code "keyword"} attribute (<em>Recommended</em>). - * - * <p><b>Path in ISO 19115:</b></p> <ul><li>{@link Metadata} / - * {@link Metadata#getIdentificationInfo() identificationInfo} / - * {@link DataIdentification#getDescriptiveKeywords() descriptiveKeywords} / - * {@link Keywords#getThesaurusName() thesaurusName} / - * {@link Citation#getTitle() title}</li></ul> - * - * @see #KEYWORDS - * @see #STANDARD_NAME_VOCABULARY - * @see <a href="http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery#keywords_vocabulary">ESIP reference</a> - * - * @deprecated Moved to {@code KEYWORDS.VOCABULARY}. - */ - @Deprecated - public static final String VOCABULARY = ACDD.keywords_vocabulary; - - /** * The {@value} attribute name for a high-level geographic data thematic classification. * Typical values are {@code "farming"}, {@code "biota"}, {@code "boundaries"}, * {@code "climatology meteorology atmosphere"}, {@code "economy"}, {@code "elevation"}, @@ -721,16 +660,6 @@ public class AttributeNames { public final Role DEFAULT_ROLE; /** - * @deprecated replaced by the constructor with one more argument (the type). - */ - @Deprecated - public Responsible(final String name, final String institution, final String url, final String email, - final String role, final Role defaultRole) - { - this(name, null, institution, url, email, role, defaultRole); - } - - /** * Creates a new set of attribute names. Any argument can be {@code null} if not applicable. * * @param name the attribute name for the responsible's name. @@ -864,11 +793,6 @@ public class AttributeNames { public static final String ACKNOWLEDGEMENT = ACDD.acknowledgement; /** - * @deprecated Renamed {@link #ACKNOWLEDGEMENT}. - */ - public static final String ACKNOWLEDGMENT = "acknowledgment"; - - /** * The {@value} attribute name for a description of the restrictions to data access * and distribution (<em>Recommended</em>). * Modified: sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -80,21 +80,6 @@ public class NetcdfStore extends DataSto * This constructor invokes {@link StorageConnector#closeAllExcept(Object)}, keeping open only the * needed resource. * - * @param connector information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>). - * @throws DataStoreException if an error occurred while opening the netCDF file. - * - * @deprecated Replaced by {@link #NetcdfStore(NetcdfStoreProvider, StorageConnector)}. - */ - @Deprecated - public NetcdfStore(final StorageConnector connector) throws DataStoreException { - this(null, connector); - } - - /** - * Creates a new netCDF store from the given file, URL, stream or {@link ucar.nc2.NetcdfFile} object. - * This constructor invokes {@link StorageConnector#closeAllExcept(Object)}, keeping open only the - * needed resource. - * * @param provider the factory that created this {@code DataStore} instance, or {@code null} if unspecified. * @param connector information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>). * @throws DataStoreException if an error occurred while opening the netCDF file. Modified: sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -32,7 +32,7 @@ import org.apache.sis.internal.netcdf.Re import org.apache.sis.internal.netcdf.impl.ChannelDecoder; import org.apache.sis.internal.netcdf.ucar.DecoderWrapper; import org.apache.sis.internal.storage.io.ChannelDataInput; -import org.apache.sis.internal.storage.Capabilities; +import org.apache.sis.internal.storage.StoreMetadata; import org.apache.sis.internal.storage.Capability; import org.apache.sis.internal.storage.URIDataStore; import org.apache.sis.internal.system.SystemListener; @@ -61,14 +61,16 @@ import org.apache.sis.util.Version; * the part of the caller. However the {@link NetcdfStore} instances created by this factory are not thread-safe. * * @author Martin Desruisseaux (Geomatys) - * @version 0.8 + * @version 1.0 * * @see NetcdfStore * * @since 0.3 * @module */ -@Capabilities(Capability.READ) +@StoreMetadata(formatName = NetcdfStoreProvider.NAME, + fileSuffixes = "nc", + capabilities = Capability.READ) public class NetcdfStoreProvider extends DataStoreProvider { /** * The format name. Modified: sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Capability.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Capability.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Capability.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Capability.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -30,7 +30,7 @@ import org.opengis.metadata.citation.Cit /** - * One aspect in the set of capabilities of a class annotated by {@link Capabilities}. + * Capabilities of a class annotated by {@link StoreMetadata}. * * <p>This is not a committed API since the way to represent data store capabilities is likely to change.</p> * @@ -83,10 +83,10 @@ public enum Capability { /* * Build a slash-separated list of capabilities. Example: "Read / write". */ - final Capabilities annotation = provider.getClass().getAnnotation(Capabilities.class); + final StoreMetadata metadata = provider.getClass().getAnnotation(StoreMetadata.class); String capabilities = null; - if (annotation != null) { - for (final Capability c : annotation.value()) { + if (metadata != null) { + for (final Capability c : metadata.capabilities()) { final String e = resources.getString(c.resourceKey); capabilities = (capabilities == null) ? e : resources.getString( Vocabulary.Keys.SlashSeparatedList_2, capabilities, e.toLowerCase(locale)); Modified: sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/DocumentedStoreProvider.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/DocumentedStoreProvider.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/DocumentedStoreProvider.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/DocumentedStoreProvider.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -16,7 +16,8 @@ */ package org.apache.sis.internal.storage; -import java.util.logging.Logger; +import java.util.logging.Level; +import java.util.logging.LogRecord; import org.opengis.metadata.distribution.Format; import org.apache.sis.metadata.sql.MetadataSource; import org.apache.sis.metadata.sql.MetadataStoreException; @@ -45,7 +46,7 @@ public abstract class DocumentedStorePro /** * {@code true} if the call to {@link #getFormat()} caught an exception. In such case, * we log a warning only the first time and use a finer logging level the other times. - * The intend is to avoid polluting the logs with too many warnings. + * The intent is to avoid polluting the logs with too many warnings. */ private volatile boolean logged; @@ -98,13 +99,17 @@ public abstract class DocumentedStorePro if (listeners != null) { listeners.warning(null, e); } else { - final Logger logger = Logging.getLogger(Modules.STORAGE); + final Level level; if (!logged) { logged = true; // Not atomic - not a big deal if we use warning level twice. - Logging.unexpectedException(logger, getClass(), "getFormat", e); + level = Level.WARNING; } else { - Logging.recoverableException(logger, getClass(), "getFormat", e); + level = Level.FINE; } + final LogRecord record = Resources.forLocale(null).getLogRecord(level, + Resources.Keys.CanNotGetCommonMetadata_2, getShortName(), e.getLocalizedMessage()); + record.setLoggerName(Modules.STORAGE); + Logging.log(getClass(), "getFormat", record); } } return super.getFormat(); Modified: sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -16,6 +16,7 @@ */ package org.apache.sis.internal.storage; +import java.time.LocalDate; import java.util.Date; import java.util.Locale; import java.util.Iterator; @@ -116,7 +117,6 @@ import static java.util.Collections.sing import static org.apache.sis.internal.util.StandardDateFormat.MILLISECONDS_PER_DAY; // Branch-dependent imports -import java.time.LocalDate; import org.opengis.feature.FeatureType; import org.opengis.metadata.citation.Responsibility; @@ -866,6 +866,25 @@ public class MetadataBuilder { } /** + * Adds a data and/or metadata identifier. This method performs the same work than + * {@link #addIdentifier(CharSequence, String, Scope)} for situations where the + * identifier instance is already available. + * + * @param id the identifier, or {@code null} if none. + * @param scope whether the date applies to data, to metadata or to both. + * + * @see #addIdentifier(CharSequence, String, Scope) + */ + public final void addIdentifier(Identifier id, final Scope scope) { + ArgumentChecks.ensureNonNull("scope", scope); + if (id != null) { + id = (Identifier) sharedValues.getOrDefault(id, id); + if (scope != Scope.RESOURCE) metadata().setMetadataIdentifier(id); + if (scope != Scope.METADATA) addIfNotPresent(citation().getIdentifiers(), id); + } + } + + /** * Adds a resource (data) identifier, a metadata identifier, or both as they are often the same. * The identifier is added only if {@code code} is non-null, regardless other argument values. * Empty strings (ignoring spaces) are ignored. @@ -882,6 +901,7 @@ public class MetadataBuilder { * * @see #addTitle(CharSequence) * @see #addTitleOrIdentifier(String, Scope) + * @see #addIdentifier(Identifier, Scope) */ public final void addIdentifier(final CharSequence authority, String code, final Scope scope) { ArgumentChecks.ensureNonNull("scope", scope); Modified: sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java [UTF-8] (original) +++ sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java [UTF-8] Sat Feb 24 15:44:08 2018 @@ -32,7 +32,7 @@ import org.apache.sis.util.resources.Res * all modules in the Apache SIS project, see {@link org.apache.sis.util.resources} package. * * @author Martin Desruisseaux (IRD, Geomatys) - * @version 0.8 + * @version 1.0 * @since 0.8 * @module */ @@ -67,6 +67,16 @@ public final class Resources extends Ind public static final short AmbiguousName_4 = 15; /** + * Can not create resources based on the content of “{0}” directory. + */ + public static final short CanNotCreateFolderStore_1 = 43; + + /** + * Can not get metadata common to “{0}” files. The reason is: {1} + */ + public static final short CanNotGetCommonMetadata_2 = 39; + + /** * Can not read the Coordinate Reference System (CRS) Well Known Text (WKT) in “{0}”. */ public static final short CanNotReadCRS_WKT_1 = 37; @@ -92,6 +102,16 @@ public final class Resources extends Ind public static final short CanNotReadFile_4 = 3; /** + * Can not remove resource “{1}” from aggregate “{0}”. + */ + public static final short CanNotRemoveResource_2 = 49; + + /** + * Can not save resources of type ‘{1}’ in a “{0}” store. + */ + public static final short CanNotStoreResourceType_2 = 41; + + /** * This {0} reader is closed. */ public static final short ClosedReader_1 = 4; @@ -112,6 +132,11 @@ public final class Resources extends Ind public static final short ConcurrentWrite_1 = 20; /** + * Whether to allow new data store creation if the source to open does not already exist. + */ + public static final short DataStoreCreate = 51; + + /** * Character encoding used by the data store. */ public static final short DataStoreEncoding = 29; @@ -132,6 +157,11 @@ public final class Resources extends Ind public static final short DataStoreTimeZone = 32; /** + * Name of the format to use for reading or writing the directory content. + */ + public static final short DirectoryContentFormatName = 40; + + /** * Content of “{0}” directory. */ public static final short DirectoryContent_1 = 35; @@ -153,6 +183,21 @@ public final class Resources extends Ind public static final short FeatureNotFound_2 = 17; /** + * A {1,choice,0#file|1#directory} already exists at “{0}”. + */ + public static final short FileAlreadyExists_2 = 45; + + /** + * The “{0}” file is not a directory of resources. + */ + public static final short FileIsNotAResourceDirectory_1 = 44; + + /** + * Whether to assemble trajectory fragments (lines in CSV file) in a single feature instance. + */ + public static final short FoliationRepresentation = 38; + + /** * The {0} data store does not accept features of type “{1}”. */ public static final short IllegalFeatureType_2 = 7; @@ -174,16 +219,41 @@ public final class Resources extends Ind public static final short InconsistentNameComponents_2 = 10; /** + * Resource “{0}” does not have an identifier. + */ + public static final short MissingResourceIdentifier_1 = 42; + + /** * Missing scheme in “{0}” URI. */ public static final short MissingSchemeInURI_1 = 11; /** + * No directory of resources found at “{0}”. + */ + public static final short NoSuchResourceDirectory_1 = 46; + + /** + * Resource “{1}” is not part of aggregate “{0}”. + */ + public static final short NoSuchResourceInAggregate_2 = 50; + + /** + * Resource “{0}” is not a writable feature set. + */ + public static final short NotAWritableFeatureSet_1 = 47; + + /** * Processing executed on {0}. */ public static final short ProcessingExecutedOn_1 = 12; /** + * A resource already exists at “{0}”. + */ + public static final short ResourceAlreadyExists_1 = 48; + + /** * More than one resource have the “{1}” identifier in the “{0}” data store. */ public static final short ResourceIdentifierCollision_2 = 23; Modified: sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties URL: http://svn.apache.org/viewvc/sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties?rev=1825252&r1=1825251&r2=1825252&view=diff ============================================================================== --- sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties [ISO-8859-1] (original) +++ sis/branches/JDK9/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties [ISO-8859-1] Sat Feb 24 15:44:08 2018 @@ -16,33 +16,47 @@ # # -# Resources in this file are for "sis-netcdf" usage only and should not be used by any other module. +# Resources in this file are for "sis-storage" usage only and should not be used by any other module. # For resources shared by all modules in the Apache SIS project, see "org.apache.sis.util.resources" package. # AmbiguousName_4 = Name \u201c{3}\u201d is ambiguous because it can be understood as either \u201c{1}\u201d or \u201c{2}\u201d in the context of \u201c{0}\u201d data. +CanNotCreateFolderStore_1 = Can not create resources based on the content of \u201c{0}\u201d directory. +CanNotGetCommonMetadata_2 = Can not get metadata common to \u201c{0}\u201d files. The reason is: {1} CanNotReadCRS_WKT_1 = Can not read the Coordinate Reference System (CRS) Well Known Text (WKT) in \u201c{0}\u201d. CanNotReadDirectory_1 = Can not read \u201c{0}\u201d directory. CanNotReadFile_2 = Can not read \u201c{1}\u201d as a file in the {0} format. CanNotReadFile_3 = Can not read line {2} of \u201c{1}\u201d as part of a file in the {0} format. CanNotReadFile_4 = Can not read line {2} (after column {3}) of \u201c{1}\u201d as part of a file in the {0} format. +CanNotRemoveResource_2 = Can not remove resource \u201c{1}\u201d from aggregate \u201c{0}\u201d. +CanNotStoreResourceType_2 = Can not save resources of type \u2018{1}\u2019 in a \u201c{0}\u201d store. ClosedReader_1 = This {0} reader is closed. ClosedWriter_1 = This {0} writer is closed. ConcurrentRead_1 = One or more read operations are in progress in the \u201c{0}\u201d data store. ConcurrentWrite_1 = A write operation is in progress in the \u201c{0}\u201d data store. +DataStoreCreate = Whether to allow new data store creation if the source to open does not already exist. DataStoreEncoding = Character encoding used by the data store. DataStoreLocale = Formating conventions of dates and numbers. DataStoreLocation = Data store location as a file or URL. DataStoreTimeZone = Timezone of dates in the data store. DirectoryContent_1 = Content of \u201c{0}\u201d directory. +DirectoryContentFormatName = Name of the format to use for reading or writing the directory content. FeatureAlreadyPresent_2 = A feature named \u201c{1}\u201d is already present in the \u201c{0}\u201d data store. FeatureNotFound_2 = Feature \u201c{1}\u201d has not been found in the \u201c{0}\u201d data store. +FileAlreadyExists_2 = A {1,choice,0#file|1#directory} already exists at \u201c{0}\u201d. +FileIsNotAResourceDirectory_1 = The \u201c{0}\u201d file is not a directory of resources. +FoliationRepresentation = Whether to assemble trajectory fragments (lines in CSV file) in a single feature instance. ExcessiveStringSize_3 = Character string in the \u201c{0}\u201d file is too long. The string has {2} characters while the limit is {1}. IllegalFeatureType_2 = The {0} data store does not accept features of type \u201c{1}\u201d. IllegalInputTypeForReader_2 = The {0} reader does not accept inputs of type \u2018{1}\u2019. IllegalOutputTypeForWriter_2 = The {0} writer does not accept outputs of type \u2018{1}\u2019. InconsistentNameComponents_2 = Components of the \u201c{1}\u201d name are inconsistent with those of the name previously binded in \u201c{0}\u201d data store. +MissingResourceIdentifier_1 = Resource \u201c{0}\u201d does not have an identifier. MissingSchemeInURI_1 = Missing scheme in \u201c{0}\u201d URI. +NoSuchResourceDirectory_1 = No directory of resources found at \u201c{0}\u201d. +NoSuchResourceInAggregate_2 = Resource \u201c{1}\u201d is not part of aggregate \u201c{0}\u201d. +NotAWritableFeatureSet_1 = Resource \u201c{0}\u201d is not a writable feature set. ProcessingExecutedOn_1 = Processing executed on {0}. +ResourceAlreadyExists_1 = A resource already exists at \u201c{0}\u201d. ResourceIdentifierCollision_2 = More than one resource have the \u201c{1}\u201d identifier in the \u201c{0}\u201d data store. ResourceNotFound_2 = No resource found for the \u201c{1}\u201d identifier in the \u201c{0}\u201d data store. ShallBeDeclaredBefore_2 = The \u201c{1}\u201d element must be declared before \u201c{0}\u201d.
