incubator-photark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r948931 - in /incubator/photark/sandbox/lresende/photark-rest/src/main/java/org/apache/photark: AlbumRef.java services/GalleryServiceImpl.java
Date Thu, 27 May 2010 17:51:20 GMT
Author: lresende
Date: Thu May 27 17:51:19 2010
New Revision: 948931

URL: http://svn.apache.org/viewvc?rev=948931&view=rev
Log:
Small enhancments to REST API to avoid NPEs during test

Modified:
    incubator/photark/sandbox/lresende/photark-rest/src/main/java/org/apache/photark/AlbumRef.java
    incubator/photark/sandbox/lresende/photark-rest/src/main/java/org/apache/photark/services/GalleryServiceImpl.java

Modified: incubator/photark/sandbox/lresende/photark-rest/src/main/java/org/apache/photark/AlbumRef.java
URL: http://svn.apache.org/viewvc/incubator/photark/sandbox/lresende/photark-rest/src/main/java/org/apache/photark/AlbumRef.java?rev=948931&r1=948930&r2=948931&view=diff
==============================================================================
--- incubator/photark/sandbox/lresende/photark-rest/src/main/java/org/apache/photark/AlbumRef.java
(original)
+++ incubator/photark/sandbox/lresende/photark-rest/src/main/java/org/apache/photark/AlbumRef.java
Thu May 27 17:51:19 2010
@@ -86,7 +86,9 @@ public class AlbumRef {
         AlbumRef albumRef = new AlbumRef();
         
         albumRef.setName(album.getName());
-        albumRef.setCoverImageRef(album.getImages().get(0).getLocation());
+        if(album.getImages().size() > 0) {
+            albumRef.setCoverImageRef(album.getImages().get(0).getLocation());
+        }
         albumRef.setRef(album.getLocation());
         
         return albumRef;

Modified: incubator/photark/sandbox/lresende/photark-rest/src/main/java/org/apache/photark/services/GalleryServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/photark/sandbox/lresende/photark-rest/src/main/java/org/apache/photark/services/GalleryServiceImpl.java?rev=948931&r1=948930&r2=948931&view=diff
==============================================================================
--- incubator/photark/sandbox/lresende/photark-rest/src/main/java/org/apache/photark/services/GalleryServiceImpl.java
(original)
+++ incubator/photark/sandbox/lresende/photark-rest/src/main/java/org/apache/photark/services/GalleryServiceImpl.java
Thu May 27 17:51:19 2010
@@ -25,9 +25,8 @@ import org.apache.photark.Gallery;
 import org.oasisopen.sca.annotation.Init;
 import org.oasisopen.sca.annotation.Scope;
 
-@Scope("COMPOSITE")
 public class GalleryServiceImpl implements GalleryService {
-    private Gallery gallery;
+    private Gallery gallery = new Gallery();
     
     @Init
     public void init() {



Mime
View raw message