Skip to content

Commit eccbdd3

Browse files
committed
DomainUtil.createUniquePropertyURI to use CaseInsensitiveHashSet
1 parent 130b9d1 commit eccbdd3

7 files changed

Lines changed: 11 additions & 6 deletions

File tree

api/src/org/labkey/api/exp/ImportTypesHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public static ImportPropertyDescriptorsList getImportPropertyDescriptors(Collect
246246
String propertyURI = StringUtils.trimToEmpty(pd.getPropertyURI());
247247
if (propertyURI.isEmpty())
248248
{
249-
pd.setPropertyURI(DomainUtil.createUniquePropertyURI(domainURI, new HashSet<>()));
249+
pd.setPropertyURI(DomainUtil.createUniquePropertyURI(domainURI));
250250
}
251251

252252
// try use existing SystemProperty PropertyDescriptor from Shared container.

api/src/org/labkey/api/exp/property/DomainUtil.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,11 @@ public static DomainProperty addProperty(Domain domain, GWTPropertyDescriptor pd
11081108
return p;
11091109
}
11101110

1111+
public static String createUniquePropertyURI(String typeURI)
1112+
{
1113+
return createUniquePropertyURI(typeURI, new CaseInsensitiveHashSet());
1114+
}
1115+
11111116
public static String createUniquePropertyURI(String typeURI, Set<String> propertyUrisInUse)
11121117
{
11131118
// Don't use property name in URIs as it can create strings that are longer than the DB column length when encoded (Issue 53586)

api/src/org/labkey/api/query/snapshot/AbstractSnapshotProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public static DomainProperty addAsDomainProperty(Domain domain, ColumnInfo colum
133133
if (name.contains("/"))
134134
name = name.replace('/', '.');
135135

136-
String propertyURI = DomainUtil.createUniquePropertyURI(domain.getTypeURI(), new HashSet<>());
136+
String propertyURI = DomainUtil.createUniquePropertyURI(domain.getTypeURI());
137137

138138
if (pd != null)
139139
{

api/src/org/labkey/api/reports/model/ReportPropsManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public synchronized DomainProperty ensureProperty(Container container, User user
117117
prop.setName(name);
118118
prop.setLabel(label);
119119
prop.setType(PropertyService.get().getType(domain.getContainer(), type.getXmlName()));
120-
prop.setPropertyURI(DomainUtil.createUniquePropertyURI(getDomainURI(container), new HashSet<>()));
120+
prop.setPropertyURI(DomainUtil.createUniquePropertyURI(getDomainURI(container)));
121121

122122
dp = prop;
123123
}

experiment/src/org/labkey/experiment/api/property/DomainImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ public DomainProperty addProperty(PropertyStorageSpec spec)
12901290
pd.setNullable(spec.isNullable());
12911291
// pd.setAutoIncrement(spec.isAutoIncrement()); // always false in PropertyDescriptor
12921292
pd.setMvEnabled(spec.isMvEnabled());
1293-
pd.setPropertyURI(DomainUtil.createUniquePropertyURI(getTypeURI(), new HashSet<>())); // Issue 53586
1293+
pd.setPropertyURI(DomainUtil.createUniquePropertyURI(getTypeURI())); // Issue 53586
12941294
pd.setDescription(spec.getDescription());
12951295
pd.setImportAliases(spec.getImportAliases());
12961296
pd.setScale(spec.getSize());

issues/src/org/labkey/issue/model/IssueListDef.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ private void ensureDomainProperties(Domain domain, AbstractIssuesListDefDomainKi
288288
DomainProperty prop = domain.addProperty();
289289

290290
prop.setName(spec.getName());
291-
prop.setPropertyURI(DomainUtil.createUniquePropertyURI(typeUri, new HashSet<>()));
291+
prop.setPropertyURI(DomainUtil.createUniquePropertyURI(typeUri));
292292
prop.setRangeURI(spec.getTypeURI());
293293
prop.setScale(spec.getSize());
294294
prop.setRequired(!spec.isNullable());

list/src/org/labkey/list/model/ListDefinitionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ private void ensureKey()
448448
}
449449

450450
DomainProperty prop = domain.addProperty();
451-
prop.setPropertyURI(DomainUtil.createUniquePropertyURI(domain.getTypeURI(), new HashSet<>()));
451+
prop.setPropertyURI(DomainUtil.createUniquePropertyURI(domain.getTypeURI()));
452452
prop.setName(getKeyName());
453453
prop.setType(PropertyService.get().getType(domain.getContainer(), getKeyType().getPropertyType().getXmlName()));
454454

0 commit comments

Comments
 (0)