Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362813 - ModelElement's copy method doesn't handle Derived properties
Summary: ModelElement's copy method doesn't handle Derived properties
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-03 11:56 EDT by Shenxue Zhou CLA
Modified: 2021-11-19 09:22 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shenxue Zhou CLA 2011-11-03 11:56:41 EDT
When a model element contains derived properties, calling it's copy() method would result in the illegal argument exception. Here is a sample of the stack trace:

java.lang.IllegalArgumentException: Cannot write property Breakpoint.
	at org.eclipse.sapphire.modeling.ModelElement.write(ModelElement.java:405)
	at oracle.eclipse.tools.adf.controller.model.internal.MethodCall.write(MethodCall.java:858)
	at org.eclipse.sapphire.modeling.ModelElement.copy(ModelElement.java:502)
	at org.eclipse.sapphire.modeling.ModelElement.copy(ModelElement.java:535)
	at oracle.eclipse.tools.adf.controller.operations.internal.CreateTaskFlowTemplateOpMethods.execute(CreateTaskFlowTemplateOpMethods.java:85)
	at oracle.eclipse.tools.adf.controller.operations.internal.CreateTaskFlowTemplateOp.execute(CreateTaskFlowTemplateOp.java:294)
	at org.eclipse.sapphire.ui.swt.SapphireWizard.performFinish(SapphireWizard.java:143)
	at org.eclipse.sapphire.ui.swt.SapphireWizard$2.run(SapphireWizard.java:107)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

I think derived properties don't need to be copied.
Comment 1 Konstantin Komissarchik CLA 2011-11-04 10:48:48 EDT
Fixed. Please verify.
Comment 2 Shenxue Zhou CLA 2011-11-04 12:14:26 EDT
Verified the fix. Closing.