incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r947762 - /incubator/aries/trunk/samples/blog/blog-biz/src/main/java/org/apache/aries/samples/blog/biz/BlogAuthorManagerImpl.java
Date Mon, 24 May 2010 18:58:23 GMT
Author: gawor
Date: Mon May 24 18:58:23 2010
New Revision: 947762

URL: http://svn.apache.org/viewvc?rev=947762&view=rev
Log:
ARIES-291: Fix 'Unparseable date' error in blog sample. Patch from Bartosz Kowalewski plus
some additional formatting changes

Modified:
    incubator/aries/trunk/samples/blog/blog-biz/src/main/java/org/apache/aries/samples/blog/biz/BlogAuthorManagerImpl.java

Modified: incubator/aries/trunk/samples/blog/blog-biz/src/main/java/org/apache/aries/samples/blog/biz/BlogAuthorManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/blog/blog-biz/src/main/java/org/apache/aries/samples/blog/biz/BlogAuthorManagerImpl.java?rev=947762&r1=947761&r2=947762&view=diff
==============================================================================
--- incubator/aries/trunk/samples/blog/blog-biz/src/main/java/org/apache/aries/samples/blog/biz/BlogAuthorManagerImpl.java
(original)
+++ incubator/aries/trunk/samples/blog/blog-biz/src/main/java/org/apache/aries/samples/blog/biz/BlogAuthorManagerImpl.java
Mon May 24 18:58:23 2010
@@ -46,16 +46,15 @@ public class BlogAuthorManagerImpl imple
     if(email == null) throw new IllegalArgumentException("Email must not be null");
    
     Date dateOfBirth;
-    
-	dateOfBirth = (dob == null || "".equals(dob)) ? null : new SimpleDateFormat("yyyy-MM-dd").parse(dob);
+    dateOfBirth = (dob == null || "".equals(dob)) ? null : new SimpleDateFormat("yyyy-MM-dd").parse(dob);
 	
     persistenceService.createAuthor(email, dateOfBirth, name, displayName, bio);
   }
   
   public List<? extends BlogAuthor> getAllAuthors()
   {
-	  List<? extends Author> authors = persistenceService.getAllAuthors();
-		return adaptAuthor(authors);
+    List<? extends Author> authors = persistenceService.getAllAuthors();
+    return adaptAuthor(authors);
   }
   
   public BlogAuthor getAuthor(String emailAddress)
@@ -63,9 +62,9 @@ public class BlogAuthorManagerImpl imple
     if(emailAddress == null) throw new IllegalArgumentException("Email must not be null");
     Author a = persistenceService.getAuthor(emailAddress);
     if (a != null)
-		return new BlogAuthorImpl(a);
-	else
-		return null;
+      return new BlogAuthorImpl(a);
+    else
+      return null;
   }
   
   public void removeAuthor(String emailAddress)
@@ -76,16 +75,16 @@ public class BlogAuthorManagerImpl imple
   
   public void updateAuthor(String email, String dob, String name, String displayName, String
bio) throws ParseException
   { 
-	  if (email == null)
-			throw new IllegalArgumentException("Email must not be null");
-    Date dateOfBirth = (dob == null) ? null : new SimpleDateFormat("yyyy-MM-dd").parse(dob);
+    if(email == null) throw new IllegalArgumentException("Email must not be null");
+   
+    Date dateOfBirth;
+    dateOfBirth = (dob == null || "".equals(dob)) ? null : new SimpleDateFormat("yyyy-MM-dd").parse(dob);
+
     persistenceService.updateAuthor(email, dateOfBirth, name, displayName, bio);
   }
   
-	private List<? extends BlogAuthor> adaptAuthor(
-			List<? extends Author> authors) {
-			return new BlogListAdapter<BlogAuthor, Author>(authors, BlogAuthorImpl.class, Author.class);
-
-	}
+  private List<? extends BlogAuthor> adaptAuthor(List<? extends Author> authors)
{
+    return new BlogListAdapter<BlogAuthor, Author>(authors, BlogAuthorImpl.class, Author.class);
+  }
  
 }



Mime
View raw message