public void commit() {
		if (this.isDeleted) {
			// Even if the field is newly-added, we can still delete it
			// without problems because its FieldInfo was already noted with
			// the ClassInfo.

			final ConstantPool cp = editor.constants();
			final int nameIndex = cp.getUTF8Index(name);
			this.editor.classInfo().deleteField(nameIndex);

		} else {
			final ConstantPool cp = editor.constants();

			fieldInfo.setNameIndex(cp.addConstant(Constant.UTF8, name));
			fieldInfo.setTypeIndex(cp.addConstant(Constant.UTF8, type
					.descriptor()));

			if (constantValue != null) {
				if (constantValue instanceof Long) {
					fieldInfo.setConstantValue(cp.addConstant(Constant.LONG,
							constantValue));
				} else if (constantValue instanceof Float) {
					fieldInfo.setConstantValue(cp.addConstant(Constant.FLOAT,
							constantValue));
				} else if (constantValue instanceof Double) {
					fieldInfo.setConstantValue(cp.addConstant(Constant.DOUBLE,
							constantValue));
				} else if (constantValue instanceof Integer) {
					fieldInfo.setConstantValue(cp.addConstant(Constant.INTEGER,
							constantValue));
				} else if (constantValue instanceof String) {
					fieldInfo.setConstantValue(cp.addConstant(Constant.STRING,
							constantValue));
				}
			}
		}

		// This field is no longer dirty
		this.isDirty = false;
	}