It's all about the answers!

Ask a question

Getting ImmutablePropertyException while modifying workitem


Yanjie Ren (622) | asked Aug 25 '11, 3:46 a.m.
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)

One answer



permanent link
David Van Herzele (10121) | answered Aug 30 '11, 4:21 a.m.
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)

Your answer


Register or to post your answer.