Bug 186135 - Integrate checks for correct implementation of clone() method
Summary: Integrate checks for correct implementation of clone() method
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL: http://www.sable.mcgill.ca/~ebodde/ge...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-09 08:25 EDT by Eric Bodden CLA
Modified: 2008-08-06 10:35 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Bodden CLA 2007-05-09 08:25:09 EDT
Hi all.

Four a course project I have developed a plugin that helps manage the concern
of object cloning in Java, using Eclipse. The plugin consists of two parts:

1.  An Eclipse builder that detects four different code smells w.r.t. cloning:
         1. Returning null from clone()
         2. Never calling super.clone().
         3. Implementing clone() but not Clooneable or vice versa.
         4. In a Java 5 project, not using the covariant return type for
            clone().
2. A code generator very similar in style to "generate hashCode()/equals()"
that allows to generate correct clone methods with selective deep copy of
fields that have as declared type a reference type that also implements
Cloneable.

You can download the plugin and a report plus slides about it at the attached
URL. My question is whether you would consider integrating this functionality
into the main Eclipse build stream. I deliberately tried to make the
implementation as consistent as possible with the current implementation similar features in Eclipse.

The flip-side for me is that because of that I use a lot of internal APIs.
Hence, integration into Eclipse would be very desirable from my point of view.

This bug is about integration of the checking part (bullet 1.) into JDT Core. Bug 182327 describes the integration of the code generation UI (bullet 2.) into JDT UI.

Thanks in advance!
Comment 1 Eric Bodden CLA 2007-11-02 23:02:03 EDT
Hey again. I was just wondering if this is going to make it into the 3.4 release. Can you tell? Thanks!
Comment 2 Jerome Lanneluc CLA 2007-11-13 06:36:31 EST
Sorry this is not on the plan for 3.4. A good quality patch with corresponding JUnit tests is still welcome though.
Comment 3 Benjamin Muskalla CLA 2008-08-06 04:55:49 EDT
Eric, is there still some interest in contributing a patch with the mentioned features?
Comment 4 Eric Bodden CLA 2008-08-06 10:35:30 EDT
Hi Benjamin.

Generally yes. I just wonder how much the APIs changed in the meantime. 

Also I am a bit tied-up right now. What would be your time frame for this?