Revision: 1389
          http://stripes.svn.sourceforge.net/stripes/?rev=1389&view=rev
Author:   bengunter
Date:     2011-01-06 14:12:59 +0000 (Thu, 06 Jan 2011)

Log Message:
-----------
Changed to use the LinkedList methods addFirst, peek, and poll instead of 
addLast, isEmpty, getLast, and removeLast

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/tag/layout/LayoutWriter.java

Modified: trunk/stripes/src/net/sourceforge/stripes/tag/layout/LayoutWriter.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/tag/layout/LayoutWriter.java      
2011-01-06 14:10:47 UTC (rev 1388)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/layout/LayoutWriter.java      
2011-01-06 14:12:59 UTC (rev 1389)
@@ -48,12 +48,12 @@
      */
     public LayoutWriter(JspWriter out) {
         log.debug("Create layout writer wrapped around ", out);
-        this.writers.add(out);
+        this.writers.addFirst(out);
     }
 
     /** Get the writer to which output is currently being written. */
     protected Writer getOut() {
-        return writers.isEmpty() ? null : writers.getLast();
+        return writers.peek();
     }
 
     /** If true, then discard all output. If false, then resume sending output 
to the JSP writer. */
@@ -80,7 +80,7 @@
     public void openBuffer(PageContext pageContext) {
         log.trace("Open buffer");
         tryFlush(pageContext);
-        writers.add(new StringWriter(1024));
+        writers.addFirst(new StringWriter(1024));
     }
 
     /**
@@ -91,7 +91,7 @@
      */
     public String closeBuffer(PageContext pageContext) {
         if (getOut() instanceof StringWriter) {
-            String contents = ((StringWriter) writers.removeLast()).toString();
+            String contents = ((StringWriter) writers.poll()).toString();
             log.trace("Closed buffer: \"", contents, "\"");
             return contents;
         }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to