You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2016/10/01 15:54:09 UTC
svn commit: r1763021 [2/3] - in /sis/branches/JDK8:
core/sis-feature/src/main/java/org/apache/sis/feature/
core/sis-feature/src/main/java/org/apache/sis/feature/builder/
core/sis-feature/src/main/java/org/apache/sis/internal/feature/
core/sis-feature/s...
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -351,9 +351,9 @@ public class EPSGDataAccess extends Geod
* by the {@link EPSGFactory#newDataAccess(Connection, SQLTranslator)} method of a corresponding custom
* {@code EPSGFactory} subclass.</div>
*
- * @param owner The {@code EPSGFactory} which is creating this Data Access Object (DAO).
- * @param connection The connection to the underlying EPSG database.
- * @param translator The translator from the SQL statements using MS-Access dialect
+ * @param owner the {@code EPSGFactory} which is creating this Data Access Object (DAO).
+ * @param connection the connection to the underlying EPSG database.
+ * @param translator the translator from the SQL statements using MS-Access dialect
* to SQL statements using the dialect of the actual database.
*
* @see EPSGFactory#newDataAccess(Connection, SQLTranslator)
@@ -372,7 +372,7 @@ public class EPSGDataAccess extends Geod
* Returns the locale used by this factory for producing error messages.
* This locale does not change the way data are read from the EPSG database.
*
- * @return The locale for error messages.
+ * @return the locale for error messages.
*/
@Override
public Locale getLocale() {
@@ -511,8 +511,8 @@ addURIs: for (int i=0; ; i++) {
* <p>An other point of view could be to said that the returned collection behaves as if the deprecated codes
* were included in the set but invisible.</p>
*
- * @param type The spatial reference objects type (may be {@code Object.class}).
- * @return The set of authority codes for spatial reference objects of the given type (may be an empty set).
+ * @param type the spatial reference objects type (may be {@code Object.class}).
+ * @return the set of authority codes for spatial reference objects of the given type (may be an empty set).
* @throws FactoryException if access to the underlying database failed.
*/
@Override
@@ -595,7 +595,7 @@ addURIs: for (int i=0; ; i++) {
* Returns an empty set since this data access class expects no namespace.
* Code shall be given to {@code createFoo(String)} methods directly, without {@code "EPSG:"} prefix.
*
- * @return Empty set.
+ * @return empty set.
*/
@Override
public Set<String> getCodeSpaces() {
@@ -606,8 +606,8 @@ addURIs: for (int i=0; ; i++) {
* Gets a description of the object corresponding to a code.
* This method returns the object name in a lightweight manner, without creating the full {@link IdentifiedObject}.
*
- * @param code Value allocated by authority.
- * @return The object name, or {@code null} if the object corresponding to the specified {@code code} has no name.
+ * @param code value allocated by authority.
+ * @return the object name, or {@code null} if the object corresponding to the specified {@code code} has no name.
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
* @throws FactoryException if the query failed for some other reason.
*/
@@ -643,7 +643,7 @@ addURIs: for (int i=0; ; i++) {
* <div class="section">Default implementation</div>
* The default implementation returns {@code true} if all characters are decimal digits 0 to 9.
*
- * @param code The code the inspect.
+ * @param code the code the inspect.
* @return {@code true} if the code is probably a primary key.
* @throws FactoryException if an unexpected error occurred while inspecting the code.
*/
@@ -667,11 +667,11 @@ addURIs: for (int i=0; ; i++) {
* <div class="note"><b>Note:</b>
* this method could be seen as the converse of above {@link #getDescriptionText(String)} method.</div>
*
- * @param table The table where the code should appears, or {@code null} if none.
- * @param codeColumn The column name for the codes, or {@code null} if none.
- * @param nameColumn The column name for the names, or {@code null} if none.
- * @param codes The codes or names to convert to primary keys, as an array of length 1 or 2.
- * @return The numerical identifiers (i.e. the table primary key values).
+ * @param table the table where the code should appears, or {@code null} if none.
+ * @param codeColumn the column name for the codes, or {@code null} if none.
+ * @param nameColumn the column name for the names, or {@code null} if none.
+ * @param codes the codes or names to convert to primary keys, as an array of length 1 or 2.
+ * @return the numerical identifiers (i.e. the table primary key values).
* @throws SQLException if an error occurred while querying the database.
*/
private int[] toPrimaryKeys(final String table, final String codeColumn, final String nameColumn, final String... codes)
@@ -739,13 +739,13 @@ addURIs: for (int i=0; ; i++) {
* {@linkplain #isPrimaryKey primary key}, then this method assumes that the code is the object name
* and will search for its primary key value.
*
- * @param table The table where the code should appears.
- * @param codeColumn The column name for the codes, or {@code null} if none.
- * @param nameColumn The column name for the names, or {@code null} if none.
- * @param sql The SQL statement to use for creating the {@link PreparedStatement} object.
+ * @param table the table where the code should appears.
+ * @param codeColumn the column name for the codes, or {@code null} if none.
+ * @param nameColumn the column name for the names, or {@code null} if none.
+ * @param sql the SQL statement to use for creating the {@link PreparedStatement} object.
* Will be used only if no prepared statement was already created for the given code.
- * @param codes The codes of the object to create, as an array of length 1 or 2.
- * @return The result of the query.
+ * @param codes the codes of the object to create, as an array of length 1 or 2.
+ * @return the result of the query.
* @throws SQLException if an error occurred while querying the database.
*/
private ResultSet executeQuery(final String table, final String codeColumn, final String nameColumn,
@@ -762,11 +762,11 @@ addURIs: for (int i=0; ; i++) {
* Creates a statement and executes for the given codes. The first code value is assigned to parameter #1,
* the second code value (if any) is assigned to parameter #2, <i>etc</i>.
*
- * @param table A key uniquely identifying the caller (e.g. {@code "Ellipsoid"} for {@link #createEllipsoid(String)}).
- * @param sql The SQL statement to use for creating the {@link PreparedStatement} object.
- * Will be used only if no prepared statement was already created for the specified key.
- * @param codes The codes of the object to create, as an array of length 1 or 2.
- * @return The result of the query.
+ * @param table a key uniquely identifying the caller (e.g. {@code "Ellipsoid"} for {@link #createEllipsoid(String)}).
+ * @param sql the SQL statement to use for creating the {@link PreparedStatement} object.
+ * Will be used only if no prepared statement was already created for the specified key.
+ * @param codes the codes of the object to create, as an array of length 1 or 2.
+ * @return the result of the query.
* @throws SQLException if an error occurred while querying the database.
*/
private ResultSet executeQuery(final String table, final String sql, final int... codes) throws SQLException {
@@ -787,9 +787,9 @@ addURIs: for (int i=0; ; i++) {
/**
* Gets the value from the specified {@link ResultSet}, or {@code null} if none.
*
- * @param result The result set to fetch value from.
- * @param columnIndex The column index (1-based).
- * @return The string at the specified column, or {@code null}.
+ * @param result the result set to fetch value from.
+ * @param columnIndex the column index (1-based).
+ * @return the string at the specified column, or {@code null}.
* @throws SQLException if an error occurred while querying the database.
*/
private static String getOptionalString(final ResultSet result, final int columnIndex) throws SQLException {
@@ -800,9 +800,9 @@ addURIs: for (int i=0; ; i++) {
/**
* Gets the value from the specified {@link ResultSet}, or {@code NaN} if none.
*
- * @param result The result set to fetch value from.
- * @param columnIndex The column index (1-based).
- * @return The number at the specified column, or {@code NaN}.
+ * @param result the result set to fetch value from.
+ * @param columnIndex the column index (1-based).
+ * @return the number at the specified column, or {@code NaN}.
* @throws SQLException if an error occurred while querying the database.
*/
private static double getOptionalDouble(final ResultSet result, final int columnIndex) throws SQLException {
@@ -813,9 +813,9 @@ addURIs: for (int i=0; ; i++) {
/**
* Gets the value from the specified {@link ResultSet}, or {@code null} if none.
*
- * @param result The result set to fetch value from.
- * @param columnIndex The column index (1-based).
- * @return The integer at the specified column, or {@code null}.
+ * @param result the result set to fetch value from.
+ * @param columnIndex the column index (1-based).
+ * @return the integer at the specified column, or {@code null}.
* @throws SQLException if an error occurred while querying the database.
*/
private static Integer getOptionalInteger(final ResultSet result, final int columnIndex) throws SQLException {
@@ -827,9 +827,9 @@ addURIs: for (int i=0; ; i++) {
* Gets the value from the specified {@link ResultSet}, or {@code false} if none.
* The EPSG database stores boolean values as integers instead than using the SQL type.
*
- * @param result The result set to fetch value from.
- * @param columnIndex The column index (1-based).
- * @return The boolean at the specified column, or {@code null}.
+ * @param result the result set to fetch value from.
+ * @param columnIndex the column index (1-based).
+ * @return the boolean at the specified column, or {@code null}.
* @throws SQLException if an error occurred while querying the database.
*/
private boolean getOptionalBoolean(final ResultSet result, final int columnIndex) throws SQLException {
@@ -865,10 +865,10 @@ addURIs: for (int i=0; ; i++) {
* Gets the string from the specified {@link ResultSet}.
* The string is required to be non-null. A null string will throw an exception.
*
- * @param code The identifier of the record where the string was found.
- * @param result The result set to fetch value from.
- * @param columnIndex The column index (1-based).
- * @return The string at the specified column.
+ * @param code the identifier of the record where the string was found.
+ * @param result the result set to fetch value from.
+ * @param columnIndex the column index (1-based).
+ * @return the string at the specified column.
* @throws SQLException if an error occurred while querying the database.
* @throws FactoryDataException if a null value was found.
*/
@@ -886,10 +886,10 @@ addURIs: for (int i=0; ; i++) {
* Gets the value from the specified {@link ResultSet}.
* The value is required to be non-null. A null value (i.e. blank) will throw an exception.
*
- * @param code The identifier of the record where the double was found.
- * @param result The result set to fetch value from.
- * @param columnIndex The column index (1-based).
- * @return The double at the specified column.
+ * @param code the identifier of the record where the double was found.
+ * @param result the result set to fetch value from.
+ * @param columnIndex the column index (1-based).
+ * @return the double at the specified column.
* @throws SQLException if an error occurred while querying the database.
* @throws FactoryDataException if a null value was found.
*/
@@ -910,10 +910,10 @@ addURIs: for (int i=0; ; i++) {
* <p>We return the value as the {@code Integer} wrapper instead than the {@code int} primitive type
* because the caller will often need that value as an object (for use as key in {@link HashMap}, etc.).</p>
*
- * @param code The identifier of the record where the integer was found.
- * @param result The result set to fetch value from.
- * @param columnIndex The column index (1-based).
- * @return The integer at the specified column.
+ * @param code the identifier of the record where the integer was found.
+ * @param result the result set to fetch value from.
+ * @param columnIndex the column index (1-based).
+ * @return the integer at the specified column.
* @throws SQLException if an error occurred while querying the database.
* @throws FactoryDataException if a null value was found.
*/
@@ -935,9 +935,9 @@ addURIs: for (int i=0; ; i++) {
* This method is invoked in the loop for making sure that, if there is more than one record
* (which should never happen), at least they have identical content.
*
- * @param newValue The newly constructed object.
- * @param oldValue The object previously constructed, or {@code null} if none.
- * @param code The EPSG code (for formatting error message).
+ * @param newValue the newly constructed object.
+ * @param oldValue the object previously constructed, or {@code null} if none.
+ * @param code the EPSG code (for formatting error message).
* @throws FactoryDataException if a duplication has been detected.
*/
private <T> T ensureSingleton(final T newValue, final T oldValue, final Comparable<?> code) throws FactoryDataException {
@@ -986,9 +986,9 @@ addURIs: for (int i=0; ; i++) {
* <p>The table name should be one of the values enumerated in the {@code epsg_table_name} type of the
* {@code EPSG_Prepare.sql} file.</p>
*
- * @param expected The expected table name (e.g. {@code "Coordinate_Operation"}).
- * @param name The actual table name.
- * @return Whether the given {@code name} is considered to match the expected name.
+ * @param expected the expected table name (e.g. {@code "Coordinate_Operation"}).
+ * @param name the actual table name.
+ * @return whether the given {@code name} is considered to match the expected name.
*/
static boolean tableMatches(final String expected, String name) {
if (name == null) {
@@ -1003,10 +1003,9 @@ addURIs: for (int i=0; ; i++) {
/**
* Logs a warning saying that the given code is deprecated and returns the code of the proposed replacement.
*
- * @param table The table of the deprecated code.
- * @param code The deprecated code.
- * @param locale The locale for logging messages.
- * @return The proposed replacement (may be the "(none)" text).
+ * @param table the table of the deprecated code.
+ * @param code the deprecated code.
+ * @return the proposed replacement (may be the "(none)" text).
*/
private String getSupersession(final String table, final Integer code, final Locale locale) throws SQLException {
String reason = null;
@@ -1041,7 +1040,7 @@ addURIs: for (int i=0; ; i++) {
}
}
if (!quiet) {
- LogRecord record = Resources.getResources(locale).getLogRecord(Level.WARNING, Resources.Keys.DeprecatedCode_3,
+ LogRecord record = Resources.forLocale(locale).getLogRecord(Level.WARNING, Resources.Keys.DeprecatedCode_3,
Constants.EPSG + DefaultNameSpace.DEFAULT_SEPARATOR + code, replacedBy, reason);
record.setLoggerName(Loggers.CRS_FACTORY);
Logging.log(EPSGDataAccess.class, method, record);
@@ -1052,12 +1051,12 @@ addURIs: for (int i=0; ; i++) {
/**
* Returns the name and aliases for the {@link IdentifiedObject} to construct.
*
- * @param table The table on which a query has been executed.
- * @param name The name for the {@link IndentifiedObject} to construct.
- * @param code The EPSG code of the object to construct.
- * @param remarks Remarks as a {@link String} or {@link InternationalString}, or {@code null} if none.
+ * @param table the table on which a query has been executed.
+ * @param name the name for the {@link IndentifiedObject} to construct.
+ * @param code the EPSG code of the object to construct.
+ * @param remarks remarks as a {@link String} or {@link InternationalString}, or {@code null} if none.
* @param deprecated {@code true} if the object to create is deprecated.
- * @return The name together with a set of properties.
+ * @return the name together with a set of properties.
*/
@SuppressWarnings("ReturnOfCollectionOrArrayField")
private Map<String,Object> createProperties(final String table, String name, final Integer code,
@@ -1151,14 +1150,14 @@ addURIs: for (int i=0; ; i++) {
/**
* Returns the name, aliases and domain of validity for the {@link IdentifiedObject} to construct.
*
- * @param table The table on which a query has been executed.
- * @param name The name for the {@link IndentifiedObject} to construct.
- * @param code The EPSG code of the object to construct.
- * @param domainCode The code for the domain of validity, or {@code null} if none.
- * @param scope The scope, or {@code null} if none.
- * @param remarks Remarks, or {@code null} if none.
- * @param deprecated {@code true} if the object to create is deprecated.
- * @return The name together with a set of properties.
+ * @param table the table on which a query has been executed.
+ * @param name the name for the {@link IndentifiedObject} to construct.
+ * @param code the EPSG code of the object to construct.
+ * @param domainCode the code for the domain of validity, or {@code null} if none.
+ * @param scope the scope, or {@code null} if none.
+ * @param remarks remarks, or {@code null} if none.
+ * @param deprecated {@code true} if the object to create is deprecated.
+ * @return the name together with a set of properties.
*/
private Map<String,Object> createProperties(final String table, final String name, final Integer code,
final String domainCode, String scope, final String remarks, final boolean deprecated)
@@ -1195,8 +1194,8 @@ addURIs: for (int i=0; ; i++) {
* It is recommended to invoke the most specific {@code createFoo(String)} method when the desired type is known,
* both for performance reason and for avoiding ambiguity.</p>
*
- * @param code Value allocated by EPSG.
- * @return The object for the given code.
+ * @param code value allocated by EPSG.
+ * @return the object for the given code.
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
* @throws FactoryException if the object creation failed for some other reason.
*
@@ -1297,8 +1296,8 @@ addURIs: for (int i=0; ; i++) {
* <tr><td>5800</td> <td>Engineering</td> <td>Astra Minas Grid</td></tr>
* </table></div>
*
- * @param code Value allocated by EPSG.
- * @return The coordinate reference system for the given code.
+ * @param code value allocated by EPSG.
+ * @return the coordinate reference system for the given code.
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
* @throws FactoryException if the object creation failed for some other reason.
*/
@@ -1576,8 +1575,8 @@ addURIs: for (int i=0; ; i++) {
* <tr><td>9315</td> <td>Engineering</td> <td>Seismic bin grid datum</td></tr>
* </table></div>
*
- * @param code Value allocated by EPSG.
- * @return The datum for the given code.
+ * @param code value allocated by EPSG.
+ * @return the datum for the given code.
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
* @throws FactoryException if the object creation failed for some other reason.
*/
@@ -1714,8 +1713,8 @@ addURIs: for (int i=0; ; i++) {
* That legacy format had a {@code TOWGS84} element which needs the information provided by this method.
* Note that {@code TOWGS84} is a deprecated element as of WKT 2 (ISO 19162).</p>
*
- * @param meridian The source datum prime meridian, used for discarding any target datum using a different meridian.
- * @param code The EPSG code of the source {@link GeodeticDatum}.
+ * @param meridian the source datum prime meridian, used for discarding any target datum using a different meridian.
+ * @param code the EPSG code of the source {@link GeodeticDatum}.
* @return an array of Bursa-Wolf parameters, or {@code null}.
*/
private BursaWolfParameters[] createBursaWolfParameters(final PrimeMeridian meridian, final Integer code)
@@ -1836,8 +1835,8 @@ addURIs: for (int i=0; ; i++) {
* <tr><td>7048</td> <td>GRS 1980 Authalic Sphere</td></tr>
* </table></div>
*
- * @param code Value allocated by EPSG.
- * @return The ellipsoid for the given code.
+ * @param code value allocated by EPSG.
+ * @return the ellipsoid for the given code.
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
* @throws FactoryException if the object creation failed for some other reason.
*
@@ -1893,7 +1892,7 @@ addURIs: for (int i=0; ; i++) {
if (!Double.isNaN(semiMinorAxis)) {
// Both 'inverseFlattening' and 'semiMinorAxis' are defined.
// Log a warning and create the ellipsoid using the inverse flattening.
- final LogRecord record = Resources.getResources(getLocale()).getLogRecord(Level.WARNING,
+ final LogRecord record = resources().getLogRecord(Level.WARNING,
Resources.Keys.AmbiguousEllipsoid_1, Constants.EPSG + DefaultNameSpace.DEFAULT_SEPARATOR + code);
record.setLoggerName(Loggers.CRS_FACTORY);
Logging.log(EPSGDataAccess.class, "createEllipsoid", record);
@@ -1926,8 +1925,8 @@ addURIs: for (int i=0; ; i++) {
* <tr><td>8906</td> <td>Rome</td></tr>
* </table></div>
*
- * @param code Value allocated by EPSG.
- * @return The prime meridian for the given code.
+ * @param code value allocated by EPSG.
+ * @return the prime meridian for the given code.
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
* @throws FactoryException if the object creation failed for some other reason.
*
@@ -1983,8 +1982,8 @@ addURIs: for (int i=0; ; i++) {
* <tr><td>3391</td> <td>World - between 80�S and 84�N</td></tr>
* </table></div>
*
- * @param code Value allocated by EPSG.
- * @return The extent for the given code.
+ * @param code value allocated by EPSG.
+ * @return the extent for the given code.
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
* @throws FactoryException if the object creation failed for some other reason.
*
@@ -2066,8 +2065,8 @@ addURIs: for (int i=0; ; i++) {
* <tr><td>6499</td> <td>Vertical CS</td> <td>height (H)</td> <td>up</td> <td>metre</td></tr>
* </table></div>
*
- * @param code Value allocated by EPSG.
- * @return The coordinate system for the given code.
+ * @param code value allocated by EPSG.
+ * @return the coordinate system for the given code.
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
* @throws FactoryException if the object creation failed for some other reason.
*/
@@ -2189,8 +2188,8 @@ addURIs: for (int i=0; ; i++) {
/**
* Returns the number of dimension for the specified Coordinate System, or {@code null} if not found.
*
- * @param cs the EPSG code for the coordinate system.
- * @return The number of dimensions, or {@code null} if not found.
+ * @param cs the EPSG code for the coordinate system.
+ * @return the number of dimensions, or {@code null} if not found.
*
* @see #getDimensionsForMethod(int)
*/
@@ -2264,8 +2263,8 @@ addURIs: for (int i=0; ; i++) {
* <tr><td>2</td> <td>Northing (N)</td> <td>metre</td></tr>
* </table></div>
*
- * @param code Value allocated by EPSG.
- * @return The axis for the given code.
+ * @param code value allocated by EPSG.
+ * @return the axis for the given code.
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
* @throws FactoryException if the object creation failed for some other reason.
*
@@ -2367,8 +2366,8 @@ addURIs: for (int i=0; ; i++) {
* <tr><td>1029</td> <td>year</td></tr>
* </table></div>
*
- * @param code Value allocated by EPSG.
- * @return The unit of measurement for the given code.
+ * @param code value allocated by EPSG.
+ * @return the unit of measurement for the given code.
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
* @throws FactoryException if the object creation failed for some other reason.
*/
@@ -2438,8 +2437,8 @@ addURIs: for (int i=0; ; i++) {
* <tr><td>8807</td> <td>False northing</td></tr>
* </table></div>
*
- * @param code Value allocated by EPSG.
- * @return The parameter descriptor for the given code.
+ * @param code value allocated by EPSG.
+ * @return the parameter descriptor for the given code.
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
* @throws FactoryException if the object creation failed for some other reason.
*
@@ -2559,8 +2558,8 @@ next: while (r.next()) {
/**
* Returns all parameter descriptors for the specified method.
*
- * @param method The operation method code.
- * @return The parameter descriptors.
+ * @param method the operation method code.
+ * @return the parameter descriptors.
* @throws SQLException if a SQL statement failed.
*/
private ParameterDescriptor<?>[] createParameterDescriptors(final Integer method) throws FactoryException, SQLException {
@@ -2581,9 +2580,9 @@ next: while (r.next()) {
/**
* Sets the values of all parameters in the given group.
*
- * @param method The EPSG code for the operation method.
- * @param operation The EPSG code for the operation (conversion or transformation).
- * @param value The parameter values to fill.
+ * @param method the EPSG code for the operation method.
+ * @param operation the EPSG code for the operation (conversion or transformation).
+ * @param value the parameter values to fill.
* @throws SQLException if a SQL statement failed.
*/
private void fillParameterValues(final Integer method, final Integer operation, final ParameterValueGroup parameters)
@@ -2671,8 +2670,8 @@ next: while (r.next()) {
* <tr><td>9624</td> <td>Affine parametric transformation</td></tr>
* </table></div>
*
- * @param code Value allocated by EPSG.
- * @return The operation method for the given code.
+ * @param code value allocated by EPSG.
+ * @return the operation method for the given code.
* @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
* @throws FactoryException if the object creation failed for some other reason.
*/
@@ -2960,9 +2959,9 @@ next: while (r.next()) {
* Deprecated operations are not included in the set; if a deprecated operation is really wanted,
* it can be fetched by an explicit call to {@link #createCoordinateOperation(String)}.</p>
*
- * @param sourceCRS Coded value of source coordinate reference system.
- * @param targetCRS Coded value of target coordinate reference system.
- * @return The operations from {@code sourceCRS} to {@code targetCRS}.
+ * @param sourceCRS coded value of source coordinate reference system.
+ * @param targetCRS coded value of target coordinate reference system.
+ * @return the operations from {@code sourceCRS} to {@code targetCRS}.
* @throws NoSuchAuthorityCodeException if a specified code was not found.
* @throws FactoryException if the object creation failed for some other reason.
*/
@@ -3035,7 +3034,7 @@ next: while (r.next()) {
* The finder tries to fetch a fully {@linkplain AbstractIdentifiedObject identified object} from an incomplete one,
* for example from an object without "{@code ID[\u2026]}" or "{@code AUTHORITY[\u2026]}" element in <cite>Well Known Text</cite>.
*
- * @return A finder to use for looking up unidentified objects.
+ * @return a finder to use for looking up unidentified objects.
* @throws FactoryException if the finder can not be created.
*/
@Override
@@ -3208,7 +3207,7 @@ next: while (r.next()) {
* Returns {@code true} if the {@link CoordinateOperation} for the specified code is a {@link Projection}.
* The caller must have verified that the designed operation is a {@link Conversion} before to invoke this method.
*
- * @throws SQLException If an error occurred while querying the database.
+ * @throws SQLException if an error occurred while querying the database.
*/
final boolean isProjection(final Integer code) throws SQLException {
Boolean projection = isProjection.get(code);
@@ -3231,8 +3230,8 @@ next: while (r.next()) {
* for all operations using that method. The returned array has a length of 2 and is never null,
* but some elements in that array may be null.
*
- * @param method The EPSG code of the operation method for which to get the dimensions.
- * @return The dimensions in an array of length 2.
+ * @param method the EPSG code of the operation method for which to get the dimensions.
+ * @return the dimensions in an array of length 2.
*
* @see #getDimensionForCS(int)
*/
@@ -3303,9 +3302,9 @@ next: while (r.next()) {
* to preserve the old ordering of the supplied codes (since deprecated operations should already be last).
* The ordering is performed in place.
*
- * @param table The table of the objects for which to check for supersession.
- * @param codes The codes, usually as an array of {@link String}. If the array do not contains string objects,
- * then the {@link Object#toString()} method must return the code for each element.
+ * @param table the table of the objects for which to check for supersession.
+ * @param codes the codes, usually as an array of {@link String}. If the array do not contains string objects,
+ * then the {@link Object#toString()} method must return the code for each element.
* @return {@code true} if the array changed as a result of this method call.
*/
final synchronized boolean sort(final String table, final Object[] codes) throws SQLException, FactoryException {
@@ -3352,9 +3351,9 @@ next: while (r.next()) {
* Creates an exception for an unknown authority code.
* This convenience method is provided for implementation of {@code createFoo(String)} methods.
*
- * @param type The GeoAPI interface that was to be created (e.g. {@code CoordinateReferenceSystem.class}).
- * @param code The unknown authority code.
- * @return An exception initialized with an error message built from the specified informations.
+ * @param type the GeoAPI interface that was to be created (e.g. {@code CoordinateReferenceSystem.class}).
+ * @param code the unknown authority code.
+ * @return an exception initialized with an error message built from the specified informations.
*/
private NoSuchAuthorityCodeException noSuchAuthorityCode(final Class<?> type, final String code) {
return new NoSuchAuthorityCodeException(resources().getString(Resources.Keys.NoSuchAuthorityCode_3,
@@ -3379,14 +3378,14 @@ next: while (r.next()) {
* Minor shortcut for fetching the resources specific to the {@code sis-referencing} module.
*/
private Resources resources() {
- return Resources.getResources(getLocale());
+ return Resources.forLocale(getLocale());
}
/**
* Logs a warning about an unexpected but non-fatal exception.
*
- * @param method The source method.
- * @param exception The exception to log.
+ * @param method the source method.
+ * @param exception the exception to log.
*/
private static void unexpectedException(final String method, final Exception exception) {
Logging.unexpectedException(Logging.getLogger(Loggers.CRS_FACTORY), EPSGDataAccess.class, method, exception);
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -293,13 +293,13 @@ public class EPSGFactory extends Concurr
if (message == null) {
message = Classes.getShortClassName(e);
}
- return Resources.getResources(locale).getString(Resources.Keys.CanNotUseGeodeticParameters_2, Constants.EPSG, message);
+ return Resources.forLocale(locale).getString(Resources.Keys.CanNotUseGeodeticParameters_2, Constants.EPSG, message);
}
/**
* Returns the namespace of EPSG codes.
*
- * @return The {@code "EPSG"} string in a singleton map.
+ * @return the {@code "EPSG"} string in a singleton map.
*/
@Override
public Set<String> getCodeSpaces() {
@@ -310,7 +310,7 @@ public class EPSGFactory extends Concurr
* Returns the locale used by this factory for producing error messages.
* This locale does not change the way data are read from the EPSG database.
*
- * @return The locale for error messages.
+ * @return the locale for error messages.
*/
@Override
public Locale getLocale() {
@@ -361,7 +361,7 @@ public class EPSGFactory extends Concurr
* or add on the classpath a non-Apache bundle like {@code geotk-epsg.jar}.
* See <a href="https://issues.apache.org/jira/browse/LEGAL-183">LEGAL-183</a> for more information.</p>
*
- * @param connection Connection to the database where to create the EPSG schema.
+ * @param connection connection to the database where to create the EPSG schema.
* @throws IOException if the SQL script can not be found or an I/O error occurred while reading them.
* @throws SQLException if an error occurred while writing to the database.
*
@@ -474,9 +474,9 @@ public class EPSGFactory extends Concurr
* Subclasses can override this method with a similar code but with {@code new EPSGDataAccess(\u2026)} replaced
* by {@code new MyDataAccessSubclass(\u2026)}.
*
- * @param connection A connection to the EPSG database.
- * @param translator The translator from the SQL statements using MS-Access dialect to SQL statements
- * using the dialect of the actual database.
+ * @param connection a connection to the EPSG database.
+ * @param translator the translator from the SQL statements using MS-Access dialect to SQL statements
+ * using the dialect of the actual database.
* @return Data Access Object (DAO) to use in {@code createFoo(String)} methods.
* @throws SQLException if a problem with the database has been detected.
*
@@ -492,7 +492,7 @@ public class EPSGFactory extends Concurr
* implementation always returns {@code false} if a set returned by {@link EPSGDataAccess#getAuthorityCodes(Class)}
* is still in use.
*
- * @param factory The Data Access Object which is about to be closed.
+ * @param factory the Data Access Object which is about to be closed.
* @return {@code true} if the given Data Access Object can be closed.
*/
@Override
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -360,13 +360,13 @@ check: for (int isTarget=0; ; isTar
if (actual == expected || actual < interpDim) {
// This check is not strictly necessary as the next check below would catch the error,
// but we provide here a hopefully more helpful error message for a common mistake.
- throw new IllegalArgumentException(Resources.getResources(properties)
+ throw new IllegalArgumentException(Resources.forProperties(properties)
.getString(Resources.Keys.MissingInterpolationOrdinates));
}
expected += interpDim;
}
if (crs != null && actual != expected) {
- throw new IllegalArgumentException(Resources.getResources(properties).getString(
+ throw new IllegalArgumentException(Resources.forProperties(properties).getString(
Resources.Keys.MismatchedTransformDimension_3, isTarget, expected, actual));
}
}
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -242,7 +242,7 @@ class AbstractSingleOperation extends Ab
* has special handling for this operation (a TensorParameters dedicated class, etc.)
*/
if (!IdentifiedObjects.isHeuristicMatchForName(method, Constants.AFFINE)) {
- throw new IllegalArgumentException(Resources.getResources(properties).getString(
+ throw new IllegalArgumentException(Resources.forProperties(properties).getString(
Resources.Keys.MismatchedTransformDimension_3, isTarget, expected, actual));
}
}
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -210,7 +210,7 @@ public class DefaultConversion extends A
this.transform = transform;
checkDimensions(method, 0, transform, properties);
} else if (parameters == null) {
- throw new IllegalArgumentException(Resources.getResources(properties)
+ throw new IllegalArgumentException(Resources.forProperties(properties)
.getString(Resources.Keys.UnspecifiedParameterValues));
}
if (parameters != null) {
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -282,7 +282,7 @@ public class DefaultCoordinateOperationF
if (method != null) {
return method;
}
- throw new NoSuchIdentifierException(Resources.getResources(defaultProperties)
+ throw new NoSuchIdentifierException(Resources.forProperties(defaultProperties)
.getString(Resources.Keys.NoSuchOperationMethod_1, name), name);
}
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -23,7 +23,6 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicReference;
-import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.lang.reflect.Constructor;
@@ -809,7 +808,7 @@ public class DefaultMathTransformFactory
}
final boolean isIvfDefinitive;
if (mismatchedParam != null) {
- final LogRecord record = Resources.getResources((Locale) null).getLogRecord(Level.WARNING,
+ final LogRecord record = Resources.forLocale(null).getLogRecord(Level.WARNING,
Resources.Keys.MismatchedEllipsoidAxisLength_3, ellipsoid.getName().getCode(),
mismatchedParam.getDescriptor().getName().getCode(), mismatchedValue);
record.setLoggerName(Loggers.COORDINATE_OPERATION);
Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -51,7 +51,7 @@ import static org.junit.Assert.*;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.4
- * @version 0.7
+ * @version 0.8
* @module
*/
@DependsOn({
@@ -60,6 +60,17 @@ import static org.junit.Assert.*;
})
public final strictfp class StandardDefinitionsTest extends TestCase {
/**
+ * Verifies value of the {@link StandardDefinitions#GREENWICH} code.
+ * This method is for ensuring consistency between hard-coded constants.
+ *
+ * @since 0.8
+ */
+ @Test
+ public void verifyGreenwichCode() {
+ assertEquals(String.valueOf(Constants.EPSG_GREENWICH), StandardDefinitions.GREENWICH);
+ }
+
+ /**
* Tests {@link StandardDefinitions#createUTM(int, GeographicCRS, double, boolean, CartesianCS)}.
*
* @since 0.7
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/CodeType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/CodeType.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/CodeType.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/CodeType.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -79,7 +79,7 @@ public class CodeType {
/**
* Sets the value from the given name.
*
- * @param name The name to marshal.
+ * @param name the name to marshal.
*/
public final void setName(final GenericName name) {
this.value = name.toString();
@@ -92,10 +92,10 @@ public class CodeType {
/**
* Returns the name from the current value.
*
- * @return The unmarshalled name.
+ * @return the unmarshalled name.
*/
public GenericName getName() {
- return Names.parseGenericName(codeSpace, ":", value);
+ return Names.parseGenericName(codeSpace, null, value);
}
/**
@@ -104,7 +104,7 @@ public class CodeType {
@XmlRootElement(name = "LocalName", namespace = Namespaces.GCO)
public static final class LocalName extends CodeType {
@Override public GenericName getName() {
- return Names.createLocalName(codeSpace, ":", value);
+ return Names.createLocalName(codeSpace, null, value);
}
}
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -32,7 +32,7 @@ import org.apache.sis.util.Static;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.5
- * @version 0.7
+ * @version 0.8
* @module
*/
public final class Constants extends Static {
@@ -199,6 +199,11 @@ public final class Constants extends Sta
public static final short EPSG_AXIS_DEGREES = 9122;
/**
+ * The EPSG code for the Greenwich prime meridian.
+ */
+ public static final short EPSG_GREENWICH = 8901;
+
+ /**
* EPSG code of "WGS 84 / Arctic Polar Stereographic" projection.
* Latitude of standard parallel is 71�N. All other parameters are zero.
*/
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameFactory.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -199,9 +199,9 @@ public class DefaultNameFactory extends
* Creates a type name from the given character sequence.
* The default implementation returns a new or an existing {@link DefaultTypeName} instance.
*
- * @param scope the {@linkplain AbstractName#scope() scope} of the type
- * name to be created, or {@code null} for a global namespace.
- * @param name the type name as a string or an international string.
+ * @param scope the {@linkplain AbstractName#scope() scope} of the type name to be created,
+ * or {@code null} for a global namespace.
+ * @param name the type name as a string or an international string.
* @return the type name for the given character sequence.
*
* @see #toTypeName(Class)
@@ -216,11 +216,13 @@ public class DefaultNameFactory extends
* Creates a member name from the given character sequence and attribute type.
* The default implementation returns a new or an existing {@link DefaultMemberName} instance.
*
- * @param scope the {@linkplain AbstractName#scope() scope} of the member
- * name to be created, or {@code null} for a global namespace.
- * @param name the member name as a string or an international string.
+ * @param scope the {@linkplain AbstractName#scope() scope} of the member name to be created,
+ * or {@code null} for a global namespace.
+ * @param name the member name as a string or an international string.
* @param attributeType the type of the data associated with the record member.
* @return the member name for the given character sequence.
+ *
+ * @see Names#createMemberName(CharSequence, String, CharSequence, Class)
*/
@Override
public MemberName createMemberName(final NameSpace scope, final CharSequence name, final TypeName attributeType) {
@@ -231,9 +233,9 @@ public class DefaultNameFactory extends
* Creates a local name from the given character sequence.
* The default implementation returns a new or an existing {@link DefaultLocalName} instance.
*
- * @param scope the {@linkplain AbstractName#scope() scope} of the local
- * name to be created, or {@code null} for a global namespace.
- * @param name the local name as a string or an international string.
+ * @param scope the {@linkplain AbstractName#scope() scope} of the local name to be created,
+ * or {@code null} for a global namespace.
+ * @param name the local name as a string or an international string.
* @return the local name for the given character sequence.
*
* @see Names#createLocalName(CharSequence, String, CharSequence)
@@ -257,10 +259,10 @@ public class DefaultNameFactory extends
* array is 1, or an instance of {@link DefaultScopedName} if the length of the array is 2
* or more.
*
- * @param scope the {@linkplain AbstractName#scope() scope} of the generic name to be created,
- * or {@code null} for a global namespace.
+ * @param scope the {@linkplain AbstractName#scope() scope} of the generic name to be created,
+ * or {@code null} for a global namespace.
* @param parsedNames the local names as an array of {@link String} or {@link InternationalString} instances.
- * This array shall contain at least one element.
+ * This array shall contain at least one element.
* @return the generic name for the given parsed names.
*
* @see #parseGenericName(NameSpace, CharSequence)
@@ -280,10 +282,9 @@ public class DefaultNameFactory extends
* This method splits the given name around a separator inferred from the given scope, or the
* {@link DefaultNameSpace#DEFAULT_SEPARATOR ':'} separator if the given scope is null.
*
- * @param scope the {@linkplain AbstractName#scope() scope} of the generic name to
- * be created, or {@code null} for a global namespace.
- * @param name the qualified name, as a sequence of names separated by a scope-dependent
- * separator.
+ * @param scope the {@linkplain AbstractName#scope() scope} of the generic name to be created,
+ * or {@code null} for a global namespace.
+ * @param name the qualified name, as a sequence of names separated by a scope-dependent separator.
* @return a name parsed from the given string.
*
* @see Names#parseGenericName(CharSequence, String, CharSequence)
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -72,7 +72,7 @@ import static org.apache.sis.util.Argume
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.5
- * @version 0.5
+ * @version 0.8
* @module
*
* @see DefaultNameFactory
@@ -92,10 +92,10 @@ public final class Names extends Static
/**
* Creates a namespace for the given name.
*
- * @param factory The factory to use for creating the namespace.
- * @param namespace The namespace string, taken as a whole (not parsed).
- * @param separator The separator between the namespace and the local part, or {@code null} for the default.
- * @return The namespace object.
+ * @param factory the factory to use for creating the namespace.
+ * @param namespace the namespace string, taken as a whole (not parsed).
+ * @param separator the separator between the namespace and the local part, or {@code null} for the default.
+ * @return the namespace object.
*/
private static NameSpace createNameSpace(final NameFactory factory, final CharSequence namespace, final String separator) {
if (namespace == null || namespace.length() == 0) {
@@ -108,17 +108,19 @@ public final class Names extends Static
/**
* Creates a local or scoped name in the given namespace.
* The character sequences can be either {@link String} or {@link InternationalString} instances.
- * The {@code namespace} character sequences is taken verbatim, while {@code scopedName} is parsed
- * as described in {@linkplain DefaultNameFactory#createGenericName(NameSpace, CharSequence...) name factory}.
+ * The {@code namespace} character sequences is taken verbatim, while {@code scopedName} is splitted
+ * around the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default separator}, which is {@code ":"}.
*
- * @param namespace The namespace, or {@code null} for the global namespace.
- * @param separator The separator between the namespace and the scoped name.
- * @param scopedName The name to parse.
- * @return A local or scoped name in the given namespace.
+ * @param namespace the namespace, or {@code null} for the global namespace.
+ * @param separator the separator between the namespace and the scoped name, or {@code null}
+ * for the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default separator}.
+ * @param scopedName the name to parse using {@code ':'} as the separator between components.
+ * @return a local or scoped name in the given namespace.
+ *
+ * @see DefaultNameFactory#parseGenericName(NameSpace, CharSequence)
*/
public static GenericName parseGenericName(final CharSequence namespace, final String separator, final CharSequence scopedName) {
ensureNonNull("localPart", scopedName);
- ensureNonNull("separator", separator);
final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
return factory.parseGenericName(createNameSpace(factory, namespace, separator), scopedName);
}
@@ -158,14 +160,16 @@ public final class Names extends Static
* to be created in the same namespace, then {@link DefaultNameFactory#createLocalName(NameSpace, CharSequence)}
* is more efficient since it allows to create the {@code NameSpace} object only once.</div>
*
- * @param namespace The namespace, or {@code null} for the global namespace.
- * @param separator The separator between the namespace and the local part.
- * @param localPart The name which is locale in the given namespace.
- * @return A local name in the given namespace.
+ * @param namespace the namespace, or {@code null} for the global namespace.
+ * @param separator the separator between the namespace and the local part, or {@code null}
+ * for the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default separator}.
+ * @param localPart the name which is locale in the given namespace.
+ * @return a local name in the given namespace.
+ *
+ * @see DefaultNameFactory#createLocalName(NameSpace, CharSequence)
*/
public static LocalName createLocalName(final CharSequence namespace, final String separator, final CharSequence localPart) {
ensureNonNull("localPart", localPart);
- ensureNonNull("separator", separator);
final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
return factory.createLocalName(createNameSpace(factory, namespace, separator), localPart);
}
@@ -182,14 +186,16 @@ public final class Names extends Static
* to be created in the same namespace, then {@link DefaultNameFactory#createTypeName(NameSpace, CharSequence)}
* is more efficient since it allows to create the {@code NameSpace} object only once.</div>
*
- * @param namespace The namespace, or {@code null} for the global namespace.
- * @param separator The separator between the namespace and the local part.
- * @param localPart The name which is locale in the given namespace.
- * @return A type name in the given namespace.
+ * @param namespace the namespace, or {@code null} for the global namespace.
+ * @param separator the separator between the namespace and the local part, or {@code null}
+ * for the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default separator}..
+ * @param localPart the name which is locale in the given namespace.
+ * @return a type name in the given namespace.
+ *
+ * @see DefaultNameFactory#createTypeName(NameSpace, CharSequence)
*/
public static TypeName createTypeName(final CharSequence namespace, final String separator, final CharSequence localPart) {
ensureNonNull("localPart", localPart);
- ensureNonNull("separator", separator);
final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
return factory.createTypeName(createNameSpace(factory, namespace, separator), localPart);
}
@@ -202,17 +208,19 @@ public final class Names extends Static
* need to be created, then {@link DefaultNameFactory#createMemberName(NameSpace, CharSequence, TypeName)}
* is more efficient since it allows to create the {@code NameSpace} and {@code TypeName} objects only once.</div>
*
- * @param namespace The namespace, or {@code null} for the global namespace.
- * @param separator The separator between the namespace and the local part.
- * @param localPart The name which is locale in the given namespace.
- * @param valueClass The type of values, used for inferring a {@link TypeName} instance.
- * @return A member name in the given namespace for values of the given type.
+ * @param namespace the namespace, or {@code null} for the global namespace.
+ * @param separator the separator between the namespace and the local part, or {@code null}
+ * for the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default separator}..
+ * @param localPart the name which is locale in the given namespace.
+ * @param valueClass the type of values, used for inferring a {@link TypeName} instance.
+ * @return a member name in the given namespace for values of the given type.
+ *
+ * @see DefaultNameFactory#createMemberName(NameSpace, CharSequence, TypeName)
*/
public static MemberName createMemberName(final CharSequence namespace, final String separator,
final CharSequence localPart, final Class<?> valueClass)
{
ensureNonNull("localPart", localPart);
- ensureNonNull("separator", separator);
ensureNonNull("valueClass", valueClass);
final DefaultNameFactory factory = DefaultFactories.forBuildin(NameFactory.class, DefaultNameFactory.class);
return factory.createMemberName(createNameSpace(factory, namespace, separator), localPart,
@@ -252,8 +260,8 @@ public final class Names extends Static
* namespaces.</li>
* </ul>
*
- * @param type The type name from which to infer a Java class.
- * @return The Java class associated to the given {@code TypeName},
+ * @param type the type name from which to infer a Java class.
+ * @return the Java class associated to the given {@code TypeName},
* or {@code null} if there is no mapping from the given name to a Java class.
* @throws UnknownNameException if a mapping from the given name to a Java class was expected to exist
* (typically because of the {@linkplain DefaultTypeName#scope() scope}) but the operation failed.
@@ -294,8 +302,8 @@ public final class Names extends Static
* NameSpace ::= name.{@linkplain AbstractName#scope() scope()}.{@linkplain DefaultNameSpace#name() name()}.toString()
* LocalPart ::= name.{@linkplain AbstractName#toString() toString()}</pre></blockquote>
*
- * @param name The generic name to format in expanded form, or {@code null}.
- * @return Expanded form of the given generic name, or {@code null} if the given name was null.
+ * @param name the generic name to format in expanded form, or {@code null}.
+ * @return expanded form of the given generic name, or {@code null} if the given name was null.
*
* @see DefaultNameSpace#toString()
*/
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=1763021&r1=1763020&r2=1763021&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] Sat Oct 1 15:54:08 2016
@@ -517,6 +517,11 @@ public final class Vocabulary extends In
public static final short StandardDeviation = 51;
/**
+ * Subset of {0}
+ */
+ public static final short SubsetOf_1 = 115;
+
+ /**
* Superseded by {0}.
*/
public static final short SupersededBy_1 = 84;
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=1763021&r1=1763020&r2=1763021&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] Sat Oct 1 15:54:08 2016
@@ -106,6 +106,7 @@ RootMeanSquare = Root Mean Squa
Scale = Scale
Source = Source
StandardDeviation = Standard deviation
+SubsetOf_1 = Subset of {0}
SupersededBy_1 = Superseded by {0}.
TemporaryFiles = Temporary files
Temporal = Temporal
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=1763021&r1=1763020&r2=1763021&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] Sat Oct 1 15:54:08 2016
@@ -113,6 +113,7 @@ RootMeanSquare = Moyenne quadra
Scale = \u00c9chelle
Source = Source
StandardDeviation = \u00c9cart type
+SubsetOf_1 = Sous-ensemble de {0}
SupersededBy_1 = Remplac\u00e9 par {0}.
TemporaryFiles = Fichiers temporaires
Temporal = Temporel
Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/iso/NamesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/iso/NamesTest.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/iso/NamesTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/iso/NamesTest.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -96,8 +96,8 @@ public final strictfp class NamesTest ex
@Test
public void testClassFromOtherNamespaces() {
assertValueClassEquals(null, Names.createTypeName("MyOrg", ":", "CharacterString"));
- assertValueClassEquals(String.class, Names.createTypeName(null, ":", "CharacterString"));
- assertValueClassEquals(null, Names.createTypeName(null, ":", "Dummy"));
+ assertValueClassEquals(String.class, Names.createTypeName(null, null, "CharacterString"));
+ assertValueClassEquals(null, Names.createTypeName(null, null, "Dummy"));
}
/**
Modified: sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Resources.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Resources.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Resources.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/Resources.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -101,7 +101,7 @@ public final class Resources extends Ind
* @return resources in the given locale.
* @throws MissingResourceException if resources can not be found.
*/
- public static Resources getResources(final Locale locale) throws MissingResourceException {
+ public static Resources forLocale(final Locale locale) throws MissingResourceException {
return getBundle(Resources.class, locale);
}
@@ -113,7 +113,7 @@ public final class Resources extends Ind
* @throws MissingResourceException if no object for the given key can be found.
*/
public static String format(final short key) throws MissingResourceException {
- return getResources(null).getString(key);
+ return forLocale(null).getString(key);
}
/**
@@ -128,7 +128,7 @@ public final class Resources extends Ind
public static String format(final short key,
final Object arg0) throws MissingResourceException
{
- return getResources(null).getString(key, arg0);
+ return forLocale(null).getString(key, arg0);
}
/**
@@ -145,7 +145,7 @@ public final class Resources extends Ind
final Object arg0,
final Object arg1) throws MissingResourceException
{
- return getResources(null).getString(key, arg0, arg1);
+ return forLocale(null).getString(key, arg0, arg1);
}
/**
@@ -164,7 +164,7 @@ public final class Resources extends Ind
final Object arg1,
final Object arg2) throws MissingResourceException
{
- return getResources(null).getString(key, arg0, arg1, arg2);
+ return forLocale(null).getString(key, arg0, arg1, arg2);
}
/**
@@ -185,6 +185,6 @@ public final class Resources extends Ind
final Object arg2,
final Object arg3) throws MissingResourceException
{
- return getResources(null).getString(key, arg0, arg1, arg2, arg3);
+ return forLocale(null).getString(key, arg0, arg1, arg2, arg3);
}
}
Modified: sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -298,7 +298,7 @@ public final class ChannelDecoder extend
* @return the localized error resource bundle.
*/
final Resources resources() {
- return Resources.getResources(listeners.getLocale());
+ return Resources.forLocale(listeners.getLocale());
}
/**
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/GenericNameMap.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/GenericNameMap.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/GenericNameMap.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/GenericNameMap.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -48,10 +48,12 @@ public final class GenericNameMap<E> {
/**
* All aliases found for all names given to the {@link #add(GenericName, Object)} method.
* Keys are aliases (never the explicitely given names) and values are names for which the key is an alias.
- * Each {@code List<GenericName>} instance contains exactly one name if there is no ambiguity.
+ * Each {@code List<String>} instance contains exactly one name if there is no ambiguity.
* If the list contains more than one name, this means that the alias is ambiguous.
+ *
+ * <p>Note that this map always have less entries than {@link #values} map.</p>
*/
- private final Map<String, List<GenericName>> aliases;
+ private final Map<String, List<String>> aliases;
/**
* The user-specified values associated to names and aliases. If a value is absent, it may means either that the
@@ -80,7 +82,7 @@ public final class GenericNameMap<E> {
if (value != null) {
return value;
}
- final List<GenericName> nc = aliases.get(name);
+ final List<String> nc = aliases.get(name);
final String message;
if (nc == null) {
message = Errors.format(Errors.Keys.ElementNotFound_1, name);
@@ -100,25 +102,24 @@ public final class GenericNameMap<E> {
* @param value the value to add (can not be null).
* @throws IllegalNameException if another element is already registered for the given name.
*/
- public void add(final GenericName name, final E value) throws IllegalNameException {
+ public void add(GenericName name, final E value) throws IllegalNameException {
ArgumentChecks.ensureNonNull("name", name);
ArgumentChecks.ensureNonNull("value", value);
- String key = name.toString();
+ final String key = name.toString();
if (values.putIfAbsent(key, value) != null) {
throw new IllegalNameException(Errors.format(Errors.Keys.ElementAlreadyPresent_1, key));
}
- GenericName tail = name;
- while (tail instanceof ScopedName) {
- tail = ((ScopedName) tail).tail();
- key = tail.toString();
- if (CollectionsExt.addToMultiValuesMap(aliases, key, name).size() > 1) {
+ while (name instanceof ScopedName) {
+ name = ((ScopedName) name).tail();
+ final String alias = name.toString();
+ if (CollectionsExt.addToMultiValuesMap(aliases, alias, key).size() > 1) {
/*
* If there is more than one GenericName for the same alias, we have an ambiguity.
* Remove any value associated to that alias. The 'get' method in this class will
* know that the value is missing because of ambiguous name.
*/
- values.remove(key);
- } else if (values.put(key, value) != null) {
+ values.remove(alias);
+ } else if (values.put(alias, value) != null) {
/*
* If no previous GenericName existed for that alias, then no value should exist for that alias.
* If a previous value existed, then (assuming that we do not have a bug in our algorithm) this
@@ -149,8 +150,8 @@ public final class GenericNameMap<E> {
boolean error = false;
while (name instanceof ScopedName) {
name = ((ScopedName) name).tail();
- String tail = name.toString();
- final List<GenericName> remaining = CollectionsExt.removeFromMultiValuesMap(aliases, tail, name);
+ final String alias = name.toString();
+ final List<String> remaining = CollectionsExt.removeFromMultiValuesMap(aliases, alias, key);
/*
* The list of remaining GenericNames may be empty, but should never be null unless the tail is
* inconsistent with the one found by the 'add(GenericName, Object) method. Otherwise if there
@@ -158,21 +159,13 @@ public final class GenericNameMap<E> {
*/
error |= (remaining == null);
if (remaining != null && remaining.size() == 1) {
- final String select = remaining.get(0).toString();
- /*
- * Extra check in case a GenericName implementation provides a broken equals(Object) method:
- * If the remaining name is the name that we were supposed to remove (when comparing String
- * representations instead than GenericName instances), then do not re-put the value.
- */
- if (!key.equals(select)) {
- error |= (values.putIfAbsent(tail, values.get(select)) != null);
- } else if (aliases.remove(tail) != remaining) {
- throw new ConcurrentModificationException();
- }
+ final String select = remaining.get(0);
+ assert !select.equals(key) : select; // Should have been removed by removeFromMultiValuesMap(\u2026).
+ error |= (values.putIfAbsent(alias, values.get(select)) != null);
}
}
if (error) {
- throw new IllegalNameException();
+ throw new IllegalNameException(Resources.format(Resources.Keys.InconsistentNameComponents_1, key));
}
return true;
}
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java [UTF-8] Sat Oct 1 15:54:08 2016
@@ -65,6 +65,11 @@ public final class Resources extends Ind
public static final short ExcessiveStringSize_3 = 0;
/**
+ * Components of the \u201c{0}\u201d name are inconsistent with those of the name that was added.
+ */
+ public static final short InconsistentNameComponents_1 = 4;
+
+ /**
* Missing scheme in \u201c{0}\u201d URI.
*/
public static final short MissingSchemeInURI_1 = 1;
@@ -107,7 +112,7 @@ public final class Resources extends Ind
* @return resources in the given locale.
* @throws MissingResourceException if resources can not be found.
*/
- public static Resources getResources(final Locale locale) throws MissingResourceException {
+ public static Resources forLocale(final Locale locale) throws MissingResourceException {
return getBundle(Resources.class, locale);
}
@@ -119,7 +124,7 @@ public final class Resources extends Ind
* @throws MissingResourceException if no object for the given key can be found.
*/
public static String format(final short key) throws MissingResourceException {
- return getResources(null).getString(key);
+ return forLocale(null).getString(key);
}
/**
@@ -134,7 +139,7 @@ public final class Resources extends Ind
public static String format(final short key,
final Object arg0) throws MissingResourceException
{
- return getResources(null).getString(key, arg0);
+ return forLocale(null).getString(key, arg0);
}
/**
@@ -151,7 +156,7 @@ public final class Resources extends Ind
final Object arg0,
final Object arg1) throws MissingResourceException
{
- return getResources(null).getString(key, arg0, arg1);
+ return forLocale(null).getString(key, arg0, arg1);
}
/**
@@ -170,6 +175,6 @@ public final class Resources extends Ind
final Object arg1,
final Object arg2) throws MissingResourceException
{
- return getResources(null).getString(key, arg0, arg1, arg2);
+ return forLocale(null).getString(key, arg0, arg1, arg2);
}
}
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties [ISO-8859-1] Sat Oct 1 15:54:08 2016
@@ -20,6 +20,7 @@
# For resources shared by all modules in the Apache SIS project, see "org.apache.sis.util.resources" package.
#
ExcessiveStringSize_3 = Character string in the \u201c{0}\u201d file is too long. The string has {2} characters while the limit is {1}.
+InconsistentNameComponents_1 = Components of the \u201c{0}\u201d name are inconsistent with those of the name that was added.
MissingSchemeInURI_1 = Missing scheme in \u201c{0}\u201d URI.
StreamIsForwardOnly_1 = Can not move backward in the \u201c{0}\u201d stream.
UnknownFormatFor_1 = Format of \u201c{0}\u201d is not recognized.
Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources_fr.properties?rev=1763021&r1=1763020&r2=1763021&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources_fr.properties [ISO-8859-1] Sat Oct 1 15:54:08 2016
@@ -25,6 +25,7 @@
# U+00A0 NO-BREAK SPACE before :
#
ExcessiveStringSize_3 = La cha\u00eene de caract\u00e8res dans le fichier \u00ab\u202f{0}\u202f\u00bb est trop longue. La cha\u00eene fait {2} caract\u00e8res alors que la limite est {1}.
+InconsistentNameComponents_1 = Les \u00e9l\u00e9ments qui composent le nom \u00ab\u202f{0}\u202f\u00bb ne sont pas coh\u00e9rents avec ceux du nom qui avait \u00e9t\u00e9 ajout\u00e9.
MissingSchemeInURI_1 = Il manque le sch\u00e9ma dans l\u2019URI \u00ab\u202f{0}\u202f\u00bb.
StreamIsForwardOnly_1 = Ne peut pas reculer dans le flux de donn\u00e9es \u00ab\u202f{0}\u202f\u00bb.
UnknownFormatFor_1 = Le format de \u00ab\u202f{0}\u202f\u00bb n\u2019est pas reconnu.