Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.4, 0.5
-
None
Description
The NamedIdentifier(Citation, CharSequence) constructor creates automatically a NameSpace (the value returned by the GenericName.scope() method) based on the Citation title. But this name space is also stored in the head (the value returned by the GenericName.head() method) of the name. This results in duplicated identifier when the full name is printed. For example:
NamedIdentifier name = new NamedIdentifier(Citations.OGC, "scale_factor"); System.out.println( name.toString() ); // Prints "OGC:scale_factor" - duplication is unnoticed. System.out.println( name.toFullyQualifiedName().toString() ); // Prints "OGC:OGC:scale_factor" - duplication become visible.
The proposed fix is to omit completely the NameSpace creation for automatically generated names. Users can still specify a name space by creating their GenericName explicitly, for example using a NameFactory or the convenience static methods provided in the Names class.