It's all about the answers!

Ask a question

ImmutablePropertyException while setting target iteration


Melanie Finke (7721520) | asked Apr 25 '12, 10:33 a.m.
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?

Accepted answer


permanent link
Michele Pegoraro (1.8k12113101) | answered Apr 26 '12, 5:10 a.m.
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

2 other answers



permanent link
Melanie Finke (7721520) | answered Apr 26 '12, 7:01 a.m.
Thank you, that was the mistake.

Regards

permanent link
Bruno Fazoli (856) | answered Jun 23 '15, 12:57 p.m.
Hi,

Could you share the code fixed?

thank you

Your answer


Register or to post your answer.