Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.2-beta1
-
Fix Version/s: 2.2-beta2
-
Component/s: Configuration
-
Labels:
-
Number of attachments :
Description
We recently improved the contract of the recently added Catalog.getStyleByName(WorkspaceInfo ws, String name) method.
It's the turn of the Catalog.getLayerGroupByName family of methods. Problem is pretty much explained on the following comment in CatalogImplTest.testGetLayerGroupByNameWithWorkspace test case: "will randomly return one... we should probably return null with multiple matches".
So far the only real world user is the REST config API, which already parsed the requested workspace/layer group name out of the request URL, so it's worth fixing the method contract now that we're early in the game, before the issue catches up on us with other callers having to deal with the non deterministic behavior.
The attached patch clarifies and enforces the contract of the getLayerGroupByName methods and keeps the build happy