| Summary: | Generate constructor using fields generates wrong parameter name | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Dirk Baeumer <dirk_baeumer> |
| Component: | UI | Assignee: | Tobias Widmer <tobias_widmer> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | trevor |
| Version: | 3.1 | ||
| Target Milestone: | 3.1 M7 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
This may be related to an issue I just noticed: Generate Constructor Using
Fields now (M6) seems to lowercase argument names:
public class TxnID
{
public final int nodeID;
public final int unitID;
public TxnID2(int nodeid, int unitid)
{
// TODO Auto-generated constructor stub
nodeID = nodeid;
unitID = unitid;
}
}
I would really prefer if no attempts were made to translate the field name. The developer has probably chosen the name carefully to make the code easy to understand. Using JDT Core naming conventions Fixed > 20050425 verified by David Saff on I20050509-2010 (In reply to comment #3) > Using JDT Core naming conventions > Fixed > 20050425 Just out of interest, where can one find the JDT naming conventions? I just did a quick test with M7 on a class including the fields 'startDate' and 'endDate'. This ended up as 'date' and 'date2'. Is this really intentional? I would have expected the names to go unchanged i.e. public class SomeClass{ private Date startDate; private Date endDate; public SomeClass( Date startDate, Date endDate ){ this.startDate=startDate; this.endDate=endDate; } } Have a look at class org.eclipse.jdt.core.NamingConventions |
private static class Data { public int modifier; public char[] name; public char[] packageName; public char[][] enclosingNames; public String path; } Generate constructor using field. Observer: you get two parameters named "name".