Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

ImmutablePropertyException while setting target iteration

Hello,

i try to set the target iteration through plain java API. the method.

workItem.setTarget(IIterationHandle i) throws the ImmutablePropertyException. I get the IIterationHandle through this code:


IDevelopmentLine developmentLine = (IDevelopmentLine) getCompleteItem(developmentLineHandle);

for (IIterationHandle iterationHandle : developmentLine
.getIterations()) {

IIteration iteration = (IIteration) getCompleteItem(iterationHandle);

if (resultIteration != null) {

return resultIteration;
}

}


The Exception is thrown, when I try to set the target.

The stackTrace is:

Exception in thread "main" com.ibm.team.repository.common.internal.ImmutablePropertyException
at com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2060)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:280)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.setTarget(WorkItemImpl.java:3113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.ibm.team.repository.common.internal.util.ItemStore$ItemInvocationHandler.invoke(ItemStore.java:597)
at $Proxy18.setTarget(Unknown Source)

Does someone know how to get rid of this exeption and set the target?

0 votes


Accepted answer

Permanent link
I think you have to use a working copy of your work-item in order to set the iteration (as other attributes).

Best regards,
Michele.
Melanie Finke selected this answer as the correct answer

0 votes


2 other answers

Permanent link
Thank you, that was the mistake.

Regards

0 votes


Permanent link
Hi,

Could you share the code fixed?

thank you

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,940

Question asked: Apr 25 '12, 10:33 a.m.

Question was seen: 5,512 times

Last updated: Jun 23 '15, 12:57 p.m.

Confirmation Cancel Confirm