commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1390778 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
Date Thu, 27 Sep 2012 00:02:58 GMT
Author: sebb
Date: Thu Sep 27 00:02:58 2012
New Revision: 1390778

URL: http://svn.apache.org/viewvc?rev=1390778&view=rev
Log:
Allow access to parsedPattern for test purposes
Make ParseException text similar to that thrown by SimpleDateFormat

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java?rev=1390778&r1=1390777&r2=1390778&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/time/FastDateParser.java
Thu Sep 27 00:02:58 2012
@@ -175,6 +175,11 @@ public class FastDateParser implements D
         return locale;
     }
 
+    // Give access to generated pattern for test code
+    Pattern getParsePattern() {
+        return parsePattern;
+    }
+
     // Basics
     //-----------------------------------------------------------------------
     /**
@@ -248,9 +253,9 @@ public class FastDateParser implements D
             if (locale.equals(JAPANESE_IMPERIAL)) {
                 throw new ParseException(
                         "(The " +locale + " locale does not support dates before 1868 AD)\n"
+
-                        source+" does not match "+parsePattern.pattern(), 0);
+                                "Unparseable date: \""+source+"\" does not match "+parsePattern.pattern(),
0);
             }
-            throw new ParseException(source+" does not match "+parsePattern.pattern(), 0);
+            throw new ParseException("Unparseable date: \""+source+"\" does not match "+parsePattern.pattern(),
0);
         }
         return date;
     }



Mime
View raw message