roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r541456 - /roller/trunk/src/org/apache/roller/ui/rendering/pagers/WeblogEntriesListPager.java
Date Thu, 24 May 2007 22:21:32 GMT
Author: snoopdave
Date: Thu May 24 15:21:32 2007
New Revision: 541456

URL: http://svn.apache.org/viewvc?view=rev&rev=541456
Log:
New JPA backend merge: change to ensure that read-only collection returned by backend is not
modified

Modified:
    roller/trunk/src/org/apache/roller/ui/rendering/pagers/WeblogEntriesListPager.java

Modified: roller/trunk/src/org/apache/roller/ui/rendering/pagers/WeblogEntriesListPager.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/rendering/pagers/WeblogEntriesListPager.java?view=diff&rev=541456&r1=541455&r2=541456
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/rendering/pagers/WeblogEntriesListPager.java (original)
+++ roller/trunk/src/org/apache/roller/ui/rendering/pagers/WeblogEntriesListPager.java Thu
May 24 15:21:32 2007
@@ -119,17 +119,14 @@
                         locale,
                         offset,
                         length + 1);
-                
-                // check if there are more results for paging
-                if(rawEntries.size() > length) {
-                    more = true;
-                    rawEntries.remove(rawEntries.size() - 1);
-                }
-                
+                                
                 // wrap the results
+                int count = 0;
                 for (Iterator it = rawEntries.iterator(); it.hasNext();) {
                     WeblogEntryData entry = (WeblogEntryData) it.next();
-                    results.add(WeblogEntryDataWrapper.wrap(entry));
+                    if (count++ < length) {
+                        results.add(WeblogEntryDataWrapper.wrap(entry));
+                    }
                 }
                 if (rawEntries.size() > length) more = true;
                 



Mime
View raw message