Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 132676

Summary: Source code feature: Add Copy Constructor
Product: [Eclipse Project] JDT Reporter: markus arbeiter <markus.arbeiter>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: Achristianson, daniel_megert, kitmaxter, nicolas, r.bhaskar, register.eclipse
Version: 3.1.2Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description markus arbeiter CLA 2006-03-21 09:23:51 EST
An additional feature in the Java Source Code Editor beside "Generate Constructor using Fields" could be "Generate Constructor using same class".

That feature would generate an attribute assignment row for all attributes in the same class. The following example snippet (see begin/end tags) would be added to the my current class 'SampleInfo' :

public class SampleInfo
{
  private int id;
  private int providerline_id;
  // more ...

  ///begin
  /**
   * Copy Constructor
   */
  public SampleInfo (SampleInfo other)
  {
  	id = other.id;
  	providerline_id = other.providerline_id;
        // more ...
  }
  ///end
}
Comment 1 Olivier Thomann CLA 2006-03-21 09:41:48 EST
Moving to JDT/UI
Comment 2 Martin Aeschlimann CLA 2006-03-21 17:15:26 EST
Good idea. Setting to later and 'helpwanted'; we currenty don't have time for this.
Comment 3 Denis Roy CLA 2009-08-30 02:17:30 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.
Comment 4 Nicolas Marchildon CLA 2014-02-13 11:13:53 EST
I have been looking for this many many times.
Comment 5 markus arbeiter CLA 2014-02-13 13:10:36 EST
Because this bug is very old I'm using the utility class PropertyUtils from Apache. In this case: 
org.apache.commons.beanutils.PropertyUtils.copyProperties(this, source);
Comment 6 andreas christianson CLA 2014-03-19 17:27:32 EDT
I'd love to see this reopened. Still a missing feature.
Comment 7 Dani Megert CLA 2014-03-21 04:27:55 EDT
(In reply to andreas christianson from comment #6)
> I'd love to see this reopened. Still a missing feature.

The bug is marked as 'helpwanted' As soon as someone steps forward and offers to provide the feature we can reopen the bug.