Index: CoerceToDouble.java
===================================================================
--- CoerceToDouble.java	(revision 2649)
+++ CoerceToDouble.java	(revision 2650)
@@ -26,6 +26,7 @@
 import java.text.NumberFormat;
 import java.text.ParsePosition;
 import java.util.Date;
+import org.apache.commons.lang3.BooleanUtils;
 import org.gvsig.tools.dataTypes.AbstractCoercion;
 import org.gvsig.tools.dataTypes.Coercion;
 
@@ -37,77 +38,82 @@
 @SuppressWarnings("UseSpecificCatch")
 public class CoerceToDouble extends AbstractCoercion {
 
-  @Override
-  public Object coerce(Object value) throws CoercionException {
-    if (value == null || value instanceof Double) {
-      return value;
+    @Override
+    public Object coerce(Object value) throws CoercionException {
+        if (value == null || value instanceof Double) {
+            return value;
+        }
+        return coerce(value, DataTypeUtils.coerceContextDefaultDecimal());
     }
-    return coerce(value, DataTypeUtils.coerceContextDefaultDecimal());
-  }
 
-  @Override
-  public Object coerce(Object value, CoercionContext context) throws CoercionException {
-    if (value == null || value instanceof Double) {
-      return value;
-    }
-    CoercionContextLocale theContext;
-    if (context instanceof CoercionContextLocale) {
-      theContext = (CoercionContextLocale) context;
-    } else {
-      theContext = DataTypeUtils.coerceContextDefaultLocale();
-    }
-    Double num;
-    try {
-      if (value instanceof Number) {
-        num = ((Number) value).doubleValue();
-        
-      } else if (value instanceof Boolean) {
-        num = ((boolean) value ? 1d : 0d);
-        
-      } else if (value instanceof Date) {
-        num = (double) (((Date) value).getTime());
-        
-      } else {
-        String s = value.toString();
-        if (s == null) {
-          return null;
+    @Override
+    public Object coerce(Object value, CoercionContext context) throws CoercionException {
+        if (value == null || value instanceof Double) {
+            return value;
         }
-        s = s.trim().toLowerCase();
-        if (s.length() == 0) {
-          return null;
-        }
-        if (s.startsWith("0x")) {
-          num = (double) Long.parseLong(s.substring(2), 16);
-          
+        CoercionContextLocale theContext;
+        if (context instanceof CoercionContextLocale) {
+            theContext = (CoercionContextLocale) context;
         } else {
-          if (s.startsWith("+")) {
-            s = s.substring(1);
-          }
-          ParsePosition p = new ParsePosition(0);
-          DecimalFormat nf = (DecimalFormat) NumberFormat.getInstance(theContext.locale());
-          Number n = nf.parse(s, p);
-          if (p.getErrorIndex() > 0 || p.getIndex() < s.length()) {
-            throw new CoercionException("Can't coerce '" + s + "' to double with locale " + theContext.locale().getLanguage() + "(error index " + p.getErrorIndex() + ", index " + p.getIndex() + ").");
-          }
-          num = n.doubleValue();
+            theContext = DataTypeUtils.coerceContextDefaultLocale();
         }
-      }
-      return num;
-    } catch (CoercionException e) {
-      throw e;
-    } catch (Exception e) {
-      throw new CoercionException("Can't coerce '" + value.toString() + "' to double with locale " + theContext.locale().getLanguage() + "'.", e);
+        Double num;
+        try {
+            if (value instanceof Number) {
+                num = ((Number) value).doubleValue();
+
+            } else if (value instanceof Boolean) {
+                num = ((boolean) value ? 1d : 0d);
+
+            } else if (value instanceof Date) {
+                num = (double) (((Date) value).getTime());
+
+            } else {
+                String s = value.toString();
+                if (s == null) {
+                    return null;
+                }
+                s = s.trim().toLowerCase();
+                if (s.length() == 0) {
+                    return null;
+                }
+                if (s.startsWith("0x")) {
+                    num = (double) Long.parseLong(s.substring(2), 16);
+
+                } else {
+                    Boolean bool = BooleanUtils.toBooleanObject(s);
+                    if (bool != null) {
+                        num = ((boolean) bool ? 1d : 0d);
+                    } else {
+                        if (s.startsWith("+")) {
+                            s = s.substring(1);
+                        }
+                        ParsePosition p = new ParsePosition(0);
+                        DecimalFormat nf = (DecimalFormat) NumberFormat.getInstance(theContext.locale());
+                        Number n = nf.parse(s, p);
+                        if (p.getErrorIndex() > 0 || p.getIndex() < s.length()) {
+                            throw new CoercionException("Can't coerce '" + s + "' to double with locale " + theContext.locale().getLanguage() + "(error index " + p.getErrorIndex() + ", index " + p.getIndex() + ").");
+                        }
+                        num = n.doubleValue();
+                    }
+                }
+            }
+            return num;
+        } catch (CoercionException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new CoercionException("Can't coerce '" + value.toString() + "' to double with locale " + theContext.locale().getLanguage() + "'.", e);
+        }
     }
-  }
 
-  public static void main(String[] args) throws CoercionException {
-    Coercion toDouble = new CoerceToDouble();
-    
-    Double x = (double) toDouble.coerce("10.5");
-    System.out.println(x);
-    x = (double) toDouble.coerce("123456789.5");
-    System.out.println(x);
-    x = (double) toDouble.coerce("123,456,789.5");
-    System.out.println(x);
-  }
+    public static void main(String[] args) throws CoercionException {
+        Coercion toDouble = new CoerceToDouble();
+
+        Double x = (double) toDouble.coerce("10.5");
+        System.out.println(x);
+        x = (double) toDouble.coerce("123456789.5");
+        System.out.println(x);
+        x = (double) toDouble.coerce("123,456,789.5");
+        System.out.println(x);
+    }
 }
