Summary: | [clone]Advice that calls clone on object always fails | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Dean Wampler <dean> | ||||||||
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> | ||||||||
Status: | RESOLVED INVALID | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | P3 | ||||||||||
Version: | 1.5.0M5 | ||||||||||
Target Milestone: | --- | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows XP | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Description
Dean Wampler
2005-12-10 18:27:23 EST
Created attachment 31524 [details]
Aspect that invokes clone() in advice
Created attachment 31525 [details]
Class that is advised, which has a clone() method
Created attachment 31526 [details]
JUnit test that drives everything.
From the javadoc for Object.clone(): The method clone for class Object performs a specific cloning operation. First, if the class of this object does not implement the interface Cloneable, then a CloneNotSupportedException is thrown. Note that all arrays are considered to implement the interface Cloneable. Otherwise, this method creates a new instance of the class of this object and initializes all its fields with exactly the contents of the corresponding fields of this object, as if by assignment; the contents of the fields are not themselves cloned. Thus, this method performs a "shallow copy" of this object, not a "deep copy" operation. --- So I changed your program such that CloneTestClass is marked 'implements Cloneable' and it seems to work now... On the mangled method thing - looks like something related to accessing a non public clone() method, possibly from advice... doing that just *sounds* like its going to cause trouble. No response, so I presume Andy's reply was accepted. stalebug |