.createFatalErrorStatus(Messages.ConvertConstantsToEnumRefactoring_FieldsHaveNotBeenSpecified));
else {
for (final Iterator it = this.fieldsToRefactor.listIterator(); it
.hasNext();) {
final IField field = (IField) it.next();
if (!field.exists()) {
String message = Messages.ConvertConstantsToEnumRefactoring_FileDoesNotExist;
status.addWarning(MessageFormat.format(message, new Object[] {field.getElementName()}));
it.remove();
}
else if (!field.isBinary()
&& !field.getCompilationUnit().isStructureKnown()) {
String message = Messages.ConvertConstantsToEnumRefactoring_CUContainsCompileErrors;
status.addWarning(MessageFormat.format(message, new Object[] {field.getCompilationUnit().getElementName()}));
it.remove();
}
else if (field.getElementName().equals("serialVersionUID")) { //$NON-NLS-1$
String message = Messages.ConvertConstantsToEnumRefactoring_FieldNotEligibleForEnum;
status.addWarning(MessageFormat.format(message, new Object[] {field.getElementName()}));
it.remove();
}
else if (Signature.getTypeSignatureKind(field
.getTypeSignature()) != Signature.BASE_TYPE_SIGNATURE) {
String message = Messages.ConvertConstantsToEnumRefactoring_FieldMustBePrimitive;
status.addWarning(MessageFormat.format(message, new Object[] {field.getElementName()}));
it.remove();
}
else if (!Util.isConstantField(field)) {
String message = Messages.ConvertConstantsToEnumRefactoring_FieldIsNotAConstant;
status.addWarning(MessageFormat.format(message, new Object[] {field.getElementName()}));
it.remove();
}
else if (Flags.isVolatile(field.getFlags())
|| Flags.isTransient(field.getFlags())) {
String message = Messages.ConvertConstantsToEnumRefactoring_FieldCannotBeExpressedAsEnum;
status.addWarning(MessageFormat.format(message, new Object[] {field.getElementName()}));
it.remove();
}
if (Signature.getElementType(field.getTypeSignature()) == Signature.SIG_BOOLEAN) {
String message = Messages.ConvertConstantsToEnumRefactoring_FieldIsBoolean;
status
.addWarning(message);
status.addWarning(MessageFormat.format(message, new Object[] {field.getElementName()}));
it.remove();
}
}
if (this.fieldsToRefactor.isEmpty())
status