Hey,
stumbled upon this code in CatalogImpl.validate(NamespaceInfo) and there
seems to be a bug:
if (!namespace.isIsolated()) {
// not an isolated namespace \ workplace so we need to check
for duplicates
existing = getNamespaceByURI(namespace.getURI());
if (existing != null &&
!existing.getId().equals(namespace.getId())) {
throw new IllegalArgumentException(
"Namespace with URI '" + namespace.getURI() + "'
already exists.");
}
}
It calls getNamespaceByURI(namespace.getURI()), but that will get you only
one of the possible many (say you have multiple isolated workspaces with
the same namespace URI)
I think the following would be correct, provided my understanding is too:
if (!namespace.isIsolated()) {
// not an isolated namespace \ workplace so we need to check
for duplicates
List<NamespaceInfo> currentList =
facade.getNamespacesByURI(namespace.getURI());
for (NamespaceInfo current : currentList) {
if (!current.getId().equals(namespace.getId())) {
throw new IllegalArgumentException(
"Namespace with URI '" + namespace.getURI() +
"' already exists.");
}
}
}
--
Gabriel Roldán
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel