Multiple components named identically but only one is visible
Hi,
We have an issue in RTC 4.0.3 with two components named identically, but only one is visible in the RTC client. Attempting to deliver to the stream using the Plain Java API fails. We retrieve the IComponentHandle using the following code, but the size of cmpnt for this particular component is two, and the debug shows there are two cmpnt elements with the same name.
List<IComponentHandle> cmpnt = SCMPlatform.getWorkspaceManager(repo).findComponents(csc, Integer.MAX_VALUE, monitor);
csc = IComponentSearchCriteria.FACTORY.newInstance();
csc.setExactName(component);
cmpnt = SCMPlatform.getWorkspaceManager(repo).findComponents(csc, Integer.MAX_VALUE, monitor);
We are not sure why there are two components named identically, it was not intentional. How can we resolve this condition? Delete one of the two components using the List "remove" method? If so, which one, element [0] or [1]? And if we do that, we are only modifying the List, I am sure we would somehow need to re-write to IWorkspaceManager the IComponentHandle from the modified List. The stream containing the component(s) is not in use currently. Would deleting and re-creating the stream resolve this condition? I'd like to know if there are any side-effects to any of the above possibilities before trying. Thanks!
Peter
One answer
As a version control system, components cannot be deleted. However, you can rename the component so that users won't be confused in the future.
If you want to enforce unique component names so that components aren't accidentally created with the same name, this has been answered in the forums before: https://jazz.net/forum/questions/32993/unique-component-names
I would also add both of those components to a workspace and inspect the recent baselines. You'll want to be sure that nobody delivered changes to the wrong component.
If you want to enforce unique component names so that components aren't accidentally created with the same name, this has been answered in the forums before: https://jazz.net/forum/questions/32993/unique-component-names
I would also add both of those components to a workspace and inspect the recent baselines. You'll want to be sure that nobody delivered changes to the wrong component.