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) |
One answer
Try getting a mutable copy with the getWorkingCopy() method on the workitem and save that mutable copy.
Cheers! Hi, |
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.