Details
Description
The method CodeList.valueOf(String) first searchs for an existing CodeList matching the given string before to create a new one. The current implementation is case-insensitive, so if a user asks for a "utf8" code list while the existing one is named "UTF8", the existing code list is returned.
We propose to additionaly ignore whitespaces. So if the user asks for "UTF 8", it is recognized as well as the existing "UTF8" code list. Currently it is not. Likewise if the user asks for "document hardcopy" in PresentationForm, it will be recognized as "documentHardcopy".
Note: it would be possible to extend the proposal for ignoring the "_" character as well, so in the above example "document hardcopy" would also be recognized as the same as "DOCUMENT_HARDCOPY", which is the same code list. The current proposal is limited to whitespaces because it is less at risk of being disruptive, given that whitespaces are normally never part of identifiers.
Attached the proposed implementation as a patch file.