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
if (unit == null) {
							return null;
						}
					} else if (!unit.equals(field.getCompilationUnit())) {
						
						return null;
					}
					try {
						final IType declaringType= field.getDeclaringType();
						if (declaringType.isInterface() || declaringType.isEnum())
							return null;
					} catch (JavaModelException exception) {
						JavaPlugin.log(exception);
						return null;
					}
					fields[index]= field;
				} else {
					return null;
				}
			}
			return fields;
		}
		return null;
	}
	private IType getSelectedType(IStructuredSelection selection) throws JavaModelException {
		Object[] elements= selection.toArray();
		if (elements.length == 1 && (elements[0] instanceof IType)) {
			IType type= (IType) elements[0];
			if (type.getCompilationUnit() != null && !type.isInterface() && !type.isEnum()) {
				return type;