Bug 100211 [source actions] Strange behavior in "Generate Constructor using Fields"
I find the behavior of "Generate Constructor using Fields" is strange in some case. Suppose you have the following file: class ID { private int publicPart; private int localPart; } Then when you call "Generate Constructor using Fields", it generates: public ID(int part, int part2) { super(); // TODO Auto-generated constructor stub publicPart = part; localPart = part2; } I don't known why the names of the two arguments are "part" and "part2", instead of "publicPart" and "localPart". The first line of the generated code, "super()", is also unnessary. So I think it will be better if you delete this line if the class does not inherit from other class (except Object).
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/GenerateConstructorUsingFieldsContentProvider.java
fUnit= parser.parse(type.getCompilationUnit(), true);
		AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) ASTNodes.getParent(NodeFinder.perform(fUnit, type.getNameRange()), AbstractTypeDeclaration.class);
		if (declaration != null) {
			fType= declaration.resolveBinding();
			if (fType != null) {
				IField field= null;
				for (Iterator iterator= fields.iterator(); iterator.hasNext();) {
					field= (IField) iterator.next();
					VariableDeclarationFragment fragment= ASTNodeSearchUtil.getFieldDeclarationFragmentNode(field, fUnit);
					if (fragment != null) {
						IVariableBinding binding= fragment.resolveBinding();
						if (binding != null)
							fFields.add(binding);
					}
				}
				final Collator collator= Collator.getInstance();
				Collections.sort(fFields, new Comparator() {
				
					public int compare(Object object1, Object object2) {
						final IVariableBinding first= (IVariableBinding) object1;
						final IVariableBinding second= (IVariableBinding) object2;
						return collator.compare(first.getName(), second.getName());
					}
				
				});
				for (Iterator iterator= selected.iterator(); iterator.hasNext();) {
					field= (IField) iterator.next();
					VariableDeclarationFragment fragment= ASTNodeSearchUtil.getFieldDeclarationFragmentNode(field, fUnit);
					if (fragment != null) {
						IVariableBinding binding= fragment.resolveBinding();