streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfrank...@apache.org
Subject [1/2] git commit: Renamed method to formatToUTC
Date Mon, 28 Apr 2014 19:22:55 GMT
Repository: incubator-streams
Updated Branches:
  refs/heads/master 1ac62d7e9 -> 8c4305045


Renamed method to formatToUTC


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/8c430504
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/8c430504
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/8c430504

Branch: refs/heads/master
Commit: 8c4305045a1ed24ac2ab0255043bd8fd6f2748f3
Parents: 2a803c3
Author: rebanks <rebanks@w2odigital.com>
Authored: Mon Apr 28 10:19:23 2014 -0500
Committer: mfranklin <mfranklin@apache.org>
Committed: Mon Apr 28 15:22:21 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/streams/data/util/RFC3339Utils.java   | 4 ++--
 .../org/apache/streams/data/data/util/RFC3339UtilsTest.java    | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/8c430504/streams-pojo/src/main/java/org/apache/streams/data/util/RFC3339Utils.java
----------------------------------------------------------------------
diff --git a/streams-pojo/src/main/java/org/apache/streams/data/util/RFC3339Utils.java b/streams-pojo/src/main/java/org/apache/streams/data/util/RFC3339Utils.java
index cc93148..187d2b0 100644
--- a/streams-pojo/src/main/java/org/apache/streams/data/util/RFC3339Utils.java
+++ b/streams-pojo/src/main/java/org/apache/streams/data/util/RFC3339Utils.java
@@ -157,7 +157,7 @@ public class RFC3339Utils {
      * @param dateString abitrarily formatted date or date and time string
      * @return {@link org.joda.time.DateTime} representation of the dateString
      */
-    public static DateTime parseToDateTime(String dateString) {
+    public static DateTime parseToUTC(String dateString) {
         try {
             return DEFAULT_FORMATTER.parseDateTime(dateString);
         } catch (Exception e) {
@@ -171,7 +171,7 @@ public class RFC3339Utils {
      * @return RFC3339 compliant date string
      */
     public static String format(String dateString) {
-        return format(parseToDateTime(dateString));
+        return format(parseToUTC(dateString));
     }
 
     private static DateTime parseUTC(DateTimeFormatter formatter, String toParse) {

http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/8c430504/streams-pojo/src/test/java/org/apache/streams/data/data/util/RFC3339UtilsTest.java
----------------------------------------------------------------------
diff --git a/streams-pojo/src/test/java/org/apache/streams/data/data/util/RFC3339UtilsTest.java
b/streams-pojo/src/test/java/org/apache/streams/data/data/util/RFC3339UtilsTest.java
index e4b4bcb..d9069c6 100644
--- a/streams-pojo/src/test/java/org/apache/streams/data/data/util/RFC3339UtilsTest.java
+++ b/streams-pojo/src/test/java/org/apache/streams/data/data/util/RFC3339UtilsTest.java
@@ -205,19 +205,19 @@ public class RFC3339UtilsTest {
         testHelper(expected, date);
         date = "2014/4/24 fesdfs";
         try {
-            RFC3339Utils.parseToDateTime(date);
+            RFC3339Utils.parseToUTC(date);
             fail("Should not have been able to parse : "+date);
         } catch (Exception e) {
         }
     }
 
     private void testHelper(DateTime expected, String dateString) {
-        DateTime parsedDate = RFC3339Utils.parseToDateTime(dateString);
+        DateTime parsedDate = RFC3339Utils.parseToUTC(dateString);
         assertEquals("Failed to parse : "+dateString, expected, parsedDate);
         String rfc3339String = RFC3339Utils.format(dateString);
         String parsedRfc3339String = RFC3339Utils.format(parsedDate);
         assertEquals("Parsed String should be equal.", parsedRfc3339String, rfc3339String);
-        DateTime convertedBack = RFC3339Utils.parseToDateTime(parsedRfc3339String);
+        DateTime convertedBack = RFC3339Utils.parseToUTC(parsedRfc3339String);
         assertEquals(expected, convertedBack);
     }
 }


Mime
View raw message