It's all about the answers!

Ask a question

Java API extending - IAncestorReport getNameItemPairs does not return pairs

Peter Moraza (481924) | asked Aug 13 '15, 10:15 p.m.

I am using RTC 5.0.2. I have three change sets associated with the same work item. Using the Java API, I am able to retrieve the INameItemPair elements of two of the three change sets, the third call to retrieve INameItemPair pairs returns null pairs. The first change set points to a .bar file, the remaining two change sets have different names and are associated with the same exact .doc file in the same path, and it is the last of those two that getNameItemPairs is returning null data on. Is this failure due to the fact that the file was accessed in the preceding call? Has anyone encountered this before?

Here is a portion of the code.

List<IVersionableHandle> versionableHandles = new ArrayList<IVersionableHandle>();
List<IAncestorReport> ancestorReports = configuration.locateAncestors(versionableHandles, monitor);
IAncestorReport iAncestorReport = ancestorReports.get(0);
List<INameItemPair> reportList = iAncestorReport.getNameItemPairs();
for (INameItemPair iNameItemPair : reportList){
   String temp = iNameItemPair.getName();
   // copy file path from iNameItemPair to String



One answer

permanent link
Chris McGee (50511117) | answered Oct 02 '15, 12:02 p.m.

According to the documentation the list of pairs will be empty if the versionable doesn't exist in the configuration. Otherwise, it is expected that the first name item pair will be empty because the component root doesn't have an ancestor. Each subsequent pair should be non-null.

Are you seeing more than one null pair in the same ancestor report?


Your answer

Register or to post 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.