GP-5326 fixed junit tests and removed check for default field names

This commit is contained in:
ghidragon 2025-03-18 12:30:03 -04:00
parent 2f581d0ead
commit 9429fa0a8e
4 changed files with 7 additions and 22 deletions

View file

@ -117,8 +117,10 @@ public interface DataTypeComponent {
*
* @param fieldName the new field name for this component.
*
* @throws DuplicateNameException if another component of the parent has
* the specified field name.
* @throws DuplicateNameException This is actually never thrown anymore. All the other ways
* of naming fields did not perform this check and it would cause quite a bit of churn to
* add that exception to all the other methods that affect field names. So to be consistent,
* we no longer do the check in this method.
*/
public void setFieldName(String fieldName) throws DuplicateNameException;

View file

@ -64,7 +64,7 @@ public interface InternalDataTypeComponent extends DataTypeComponent {
public default String cleanupFieldName(String name) {
// For now, silently convert whitespace to underscores
String fieldName = StringUtilities.whitespaceToUnderscores(name);
if (StringUtils.isBlank(fieldName) || fieldName.equals(getDefaultFieldName())) {
if (StringUtils.isBlank(fieldName)) {
fieldName = null;
}
return fieldName;