It's all about the answers!

Ask a question

Using handles as map keys


Jeff Care (1.0k3833) | asked Mar 18 '11, 4:48 p.m.
https://jazz.net/wiki/bin/view/Main/RTCSDK20_SourceControl warns against using item handles as map keys.

The javadoc for com.ibm.team.scm.common.dto.IChangeHistorySyncReport.localBases() says that IComponentHandle is used as the key for the returned map.

Is it safe to use handles for map keys? Is it only safe for certain kinds of handles?

2 answers



permanent link
Jeff Care (1.0k3833) | answered Mar 29 '11, 11:37 a.m.
Still waiting for an answer on this one.

permanent link
Ralph Schoon (63.2k33646) | answered Apr 04 '11, 5:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,

I searched for references for Work Item handles in the SDK.

package com.ibm.team.apt.internal.client.private DTO_ResolvedWorkItem2 checkForParentCycles(List<DTO_ResolvedWorkItem2> items)

Uses handles as map keys. I would assume it is safe then. Otherwise you could use the ID.

Ralph

Still waiting for an answer on this one.

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.