How to locate a change set in stream using plain java API?
Rinkal Garg (17●2●9)
| asked May 15 '18, 3:04 a.m.
edited Jun 01 '18, 3:25 p.m. by David Lafreniere (4.8k●7) I am using the below code :
change.getItemId().getUuidValue().toString());
IWorkspaceSearchCriteria wsSearchCriteria1 = IWorkspaceSearchCriteria.FACTORY.newInstance();
wsSearchCriteria1.setKind(IWorkspaceSearchCriteria.WORKSPACES);
wsSearchCriteria1.setExactName(connectedStreamNew.getName());
List<IWorkspaceHandle> streamHandleList1 = workspaceManager.findWorkspaces(wsSearchCriteria1,
Integer.MAX_VALUE, monitor);
ILocateChangeSetsSearchCriteria scope = ILocateChangeSetsSearchCriteria.FACTORY
.create(changeSetHandle, streamHandleList1, Collections.EMPTY_LIST, Collections.EMPTY_LIST);
IWorkspaceManager workspaceManager1 = SCMPlatform.getWorkspaceManager(repoCasa);
List<ILocateChangeSetsSearchResult> result = workspaceManager1.locateChangeSets(scope, monitor);
But in last line of code I am getting an exception :Exception in thread "main" java.lang.IllegalArgumentException
at com.ibm.team.scm.client.internal.WorkspaceManager.locateChangeSets(WorkspaceManager.java:252)
|
One answer
The IllegalArgumentException is thrown due to this code:
if (scope.getWorkspaces().isEmpty() && scope.getSnapshots().isEmpty() && scope.getBaselines().isEmpty()) {
throw new IllegalArgumentException("The search criteria scope must provide at least one workspace, snapshot or baseline"); //$NON-NLS-1$ }
This means that in your case 'streamHandleList1' is empty, which can very well be, as you are trying to find all repository workspaces which appear to have the name of some stream (with the exact name of: "connectedStreamNew.getName()")
What is it you were trying to do there?
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
@rschoon Can you help me in this?