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

Getting ImmutablePropertyException while modifying workitem

Hi,
I am trying to programatically modify a workitem, I got this exception when trying to save the working copy after the modifications.

Here is the my code to save the project area.

workItem.setHTMLSummary(XMLString.createFromPlainText( ******: **********************************(********)));

I think the above code cause the error. Maybe the summary be too long? Or it has invalid characters? Any ideas what I am doing wrong? Thanks.

Exception in thread "main" com.ibm.team.repository.common.internal.ImmutablePropertyException
at com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2049)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:247)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.setSummary(WorkItemImpl.java:1165)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.setHTMLSummary(WorkItemImpl.java:1151)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.ibm.team.repository.common.internal.util.ItemStore$ItemInvocationHandler.invoke(ItemStore.java:596)
at $Proxy18.setHTMLSummary(Unknown Source)
at bridge.UpdateWorkItem.modifyWorkItem(UpdateWorkItem.java:195)
at bridge.BridgeHandle.Handle(BridgeHandle.java:220)
at bridge.BridgeHandle.main(BridgeHandle.java:364)

0 votes



One answer

Permanent link
Try getting a mutable copy with the getWorkingCopy() method on the workitem and save that mutable copy.

Cheers!

Hi,
I am trying to programatically modify a workitem, I got this exception when trying to save the working copy after the modifications.

Here is the my code to save the project area.

workItem.setHTMLSummary(XMLString.createFromPlainText( ******: **********************************(********)));

I think the above code cause the error. Maybe the summary be too long? Or it has invalid characters? Any ideas what I am doing wrong? Thanks.

Exception in thread "main" com.ibm.team.repository.common.internal.ImmutablePropertyException
at com.ibm.team.repository.common.internal.util.ItemUtil$ProtectAdapter.notifyChanged(ItemUtil.java:2049)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:247)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.setSummary(WorkItemImpl.java:1165)
at com.ibm.team.workitem.common.internal.model.impl.WorkItemImpl.setHTMLSummary(WorkItemImpl.java:1151)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.ibm.team.repository.common.internal.util.ItemStore$ItemInvocationHandler.invoke(ItemStore.java:596)
at $Proxy18.setHTMLSummary(Unknown Source)
at bridge.UpdateWorkItem.modifyWorkItem(UpdateWorkItem.java:195)
at bridge.BridgeHandle.Handle(BridgeHandle.java:220)
at bridge.BridgeHandle.main(BridgeHandle.java:364)

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,941

Question asked: Aug 25 '11, 3:46 a.m.

Question was seen: 6,091 times

Last updated: Aug 25 '11, 3:46 a.m.

Confirmation Cancel Confirm