Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/featuretype/DefaultFeatureTypePanel.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/featuretype/DefaultFeatureTypePanel.java	(revision 44499)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/featuretype/DefaultFeatureTypePanel.java	(revision 44500)
@@ -27,6 +27,7 @@
 import org.gvsig.tools.swing.api.ChangeListenerHelper;
 import org.gvsig.tools.swing.api.ToolsSwingLocator;
 import org.gvsig.tools.swing.api.ToolsSwingManager;
+import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -40,7 +41,8 @@
     {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(DefaultFeatureTypePanel.class);
-
+    private FeatureType originalFeatureType;
+    
     private class FeatureTypeTableModel extends AbstractTableModel {
 
         private final FeatureType featureType;
@@ -243,12 +245,35 @@
             return true;
         }
         FeatureAttributeDescriptor descriptor = this.featureType.getAttributeDescriptor(row);
+        int previousType = descriptor.getType();
         if( descriptor instanceof EditableFeatureAttributeDescriptor ) {
             if( this.descriptorPanel.fetch((EditableFeatureAttributeDescriptor) descriptor)==null ) {
                 return false;
             }
             this.tableModel.fireUpdateEvent();
         } 
+
+        FeatureAttributeDescriptor oldDescriptor = this.originalFeatureType.getAttributeDescriptor(descriptor.getName());
+            if (oldDescriptor !=null &&
+                   oldDescriptor.getDataType()!=descriptor.getDataType() &&
+                    previousType != descriptor.getType()) {
+               ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager();
+            I18nManager i18manager = ToolsLocator.getI18nManager();
+            StringBuilder message = new StringBuilder();
+            
+            String[] messageArgs = new String[]{oldDescriptor.getName()};
+            message.append(i18manager.getTranslation("_Already_existed_a_field_named_XfieldnameX_but_with_different_data_type", messageArgs));
+            message.append(".\n");
+            message.append(i18manager.getTranslation("_Values_of_data_will_try_to_coerce_to_this_type"));
+               dialogs.messageDialog(
+                       message.toString(),
+                       null,
+                       i18manager.getTranslation("_Values_will_change"),
+                       JOptionPane.INFORMATION_MESSAGE,
+                       "feature-type-manager-field-already-exist-in-previous-schema");
+           }
+            
+        
         return true;
     }
     
@@ -377,6 +402,11 @@
 
     @Override
     public void put(FeatureType type) {
+        FeatureType ftypeToCompare = type.getOriginalFeatureType();
+        if (ftypeToCompare==null) {
+            ftypeToCompare = type;
+        } 
+        this.originalFeatureType = ftypeToCompare.getCopy();
         this.featureType = type;
         if( type == null ) {
             this.store = null;
@@ -407,7 +437,7 @@
     private void doNewField() {
         EditableFeatureType eft = (EditableFeatureType)this.featureType;
         EditableFeatureAttributeDescriptor descriptor = eft.add(
-                getNewFieldName(this.featureType), 
+                this.featureType.getNewFieldName(), 
                 DataTypes.STRING,
                 50
         );
@@ -436,20 +466,6 @@
         doFormFieldPut();       
         this.changeListenerHelper.fireEvent();
     }
-            
-    public static String getNewFieldName(FeatureType featureType) {
-        I18nManager i18n = ToolsLocator.getI18nManager();
-        String prefix = i18n.getTranslation("_Field");
-        String fieldName;
-        for (int i = 1; i < 1000; i++) {
-            fieldName = prefix +"-"+i;
-            if( featureType.get(fieldName)==null ) {
-                return fieldName;
-            }
-        }
-        fieldName = prefix + "-" + (new Date()).getTime();
-        return fieldName;
-    }
 
     @Override
     public void addChangeListener(ChangeListener listener) {
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/test/java/org/gvsig/fmap/dal/feature/DummyFeatureType.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/test/java/org/gvsig/fmap/dal/feature/DummyFeatureType.java	(revision 44499)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/test/java/org/gvsig/fmap/dal/feature/DummyFeatureType.java	(revision 44500)
@@ -466,4 +466,9 @@
         return null;
     }
 
+    @Override
+    public FeatureType getOriginalFeatureType() {
+        return null;
+    }
+
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureType.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureType.java	(revision 44499)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureType.java	(revision 44500)
@@ -332,4 +332,12 @@
     FeatureStore getAsFeatureStore();
     
     public String getNewFieldName();
+     /**
+     * Return the store associated to this type.
+     * It will return Null when it's in not editing mode
+     * or the featureType has not been change
+     * 
+     * @return the original FeatureStore of the type.
+     */
+    public FeatureType getOriginalFeatureType();
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureStore.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureStore.java	(revision 44499)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureStore.java	(revision 44500)
@@ -3116,4 +3116,16 @@
         return this.provider.isTemporary();
     }
     
+    public FeatureType getOriginalFeatureType(FeatureType featureType)  {
+        // FIXME this don't work for Store.fType.size() > 1
+        FeatureTypeManager manager = this.featureTypeManager;
+         if (manager==null) {
+             return null;
+         }
+         FeatureType originalFeatureType = manager.getOriginalFeatureType();
+         if (originalFeatureType==null) {
+             return null;
+         }
+         return originalFeatureType.getCopy();
+    }
 }
\ No newline at end of file
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureType.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureType.java	(revision 44499)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureType.java	(revision 44500)
@@ -1115,5 +1115,12 @@
         fieldName = prefix + "-" + (new Date()).getTime();
         return fieldName;
     }
-
+    
+   public FeatureType getOriginalFeatureType()  {
+        DefaultFeatureStore store = (DefaultFeatureStore) this.getStore();
+        if (store==null) {
+            return null;
+        }
+        return store.getOriginalFeatureType(this);
+    }
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text.properties
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text.properties	(revision 44499)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text.properties	(revision 44500)
@@ -1384,3 +1384,5 @@
 _Use_labels_and_names=Usar etiquetas y nombres
 _Documents=Documentos
 _Search_by_attributes=Busqueda por atributos
+_Already_existed_a_field_named_XfieldnameX_but_with_different_data_type=Ya existe un campo llamado "{0}" pero con otro tipo de dato
+_Values_of_data_will_try_to_coerce_to_this_type=Los valores intentar\u00e1n transformarse a este nuevo tipo de dato.
\ No newline at end of file
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties	(revision 44499)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties	(revision 44500)
@@ -1304,4 +1304,5 @@
 _Use_labels_and_names=Use labels and names
 _Documents=Documents
 _Search_by_attributes=Search by attributes
-
+_Already_existed_a_field_named_XfieldnameX_but_with_different_data_type=Already existed a field named "{0}" but with different data type
+_Values_of_data_will_try_to_coerce_to_this_type=Values of data will try to coerce to this type
