Bug 100820 [source actions] [5.0] create constructor using fields adds wrong super call to enum
3.1-RC2 - have the cu below - select Source>Create Ctor using fields --------- Natural.java ----- enum Natural { ONE, TWO; private final int fField; } ---------------------------- Expected ctor: private Natural(int field) { // TODO Auto-generated constructor stub fField = field; } Actual ctor: private Natural(String name, int ordinal, int field) { super(name, ordinal); // TODO Auto-generated constructor stub fField = field; }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateNewConstructorUsingFieldsAction.java
private boolean canRunOn(IField[] fields) throws JavaModelException {
		if (fields != null && fields.length > 0) {
			for (int index= 0; index < fields.length; index++) {
				if (JdtFlags.isEnum(fields[index])) {
					MessageDialog.openInformation(getShell(), ActionMessages.GenerateConstructorUsingFieldsAction_error_title, ActionMessages.GenerateConstructorUsingFieldsAction_enum_not_applicable); 
					return false;
				}
			}
			return true;
		}
		return false;
	}
	private boolean checkEnabledEditor() {
		return fEditor != null && SelectionConverter.canOperateOn(fEditor);
	}
	/*
	 * Returns fields in the selection or <code>null</code> if the selection is empty or
	 * not valid.
	 */
	private IField[] getSelectedFields(IStructuredSelection selection) {
		List elements= selection.toList();
		if (elements.size() > 0) {
			IField[] fields= new IField[elements.size()];
			ICompilationUnit unit= null;
			for (int index= 0; index < elements.size(); index++) {
				if (elements.get(index) instanceof IField) {
					IField field= (IField) elements.get(index);
					if (index == 0) {
						
						unit= field.getCompilationUnit();