commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r475060 - /jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java
Date Tue, 14 Nov 2006 23:45:31 GMT
Author: bayard
Date: Tue Nov 14 15:45:30 2006
New Revision: 475060

URL: http://svn.apache.org/viewvc?view=rev&rev=475060
Log:
Adding a bit more data to the conversion error messages

Modified:
    jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java

Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java?view=diff&rev=475060&r1=475059&r2=475060
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java
(original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/converters/DateTimeConverter.java
Tue Nov 14 15:45:30 2006
@@ -399,7 +399,7 @@
                 return java.sql.Date.valueOf(value);
             } catch (IllegalArgumentException e) {
                 throw new ConversionException(
-                        "Date must be in JDBC format [yyyy-MM-dd]");
+                        "String must be in JDBC format [yyyy-MM-dd] to create a java.sql.Date");
             }
         }
 
@@ -409,7 +409,7 @@
                 return java.sql.Time.valueOf(value);
             } catch (IllegalArgumentException e) {
                 throw new ConversionException(
-                        "Time must be in JDBC format [HH:mm:ss]");
+                        "String must be in JDBC format [HH:mm:ss] to create a java.sql.Time");
             }
         }
 
@@ -419,7 +419,8 @@
                 return java.sql.Timestamp.valueOf(value);
             } catch (IllegalArgumentException e) {
                 throw new ConversionException(
-                        "Timestamp must be in JDBC format [yyyy-MM-dd HH:mm:ss.fffffffff]");
+                        "String must be in JDBC format [yyyy-MM-dd HH:mm:ss.fffffffff] "
+
+                        "to create a java.sql.Timestamp");
             }
         }
 
@@ -489,7 +490,7 @@
             }
         }
         if (patterns.length > 1) {
-            throw new ConversionException("Error converting to '" + toString(type)
+            throw new ConversionException("Error converting String to '" + toString(type)
                     + "' using  patterns '" + displayPatterns + "'");
         } else {
             throw firstEx;
@@ -512,7 +513,7 @@
         ParsePosition pos = new ParsePosition(0);
         Date parsedDate = format.parse(value, pos); // ignore the result (use the Calendar)
         if (pos.getErrorIndex() >= 0 || pos.getIndex() != value.length() || parsedDate
== null) {
-            String msg = "Error converting to '" + toString(type) + "'";
+            String msg = "Error converting String to '" + toString(type) + "'";
             if (format instanceof SimpleDateFormat) {
                 msg += " using pattern '" + ((SimpleDateFormat)format).toPattern() + "'";
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message