[hornetq-commits] JBoss hornetq SVN: r12000 - trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jan 9 06:17:37 EST 2012


Author: borges
Date: 2012-01-09 06:17:36 -0500 (Mon, 09 Jan 2012)
New Revision: 12000

Modified:
   trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/LivePageCacheImpl.java
Log:
Make synchronization of 'messages' array consistent (does not really affect running code).

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/LivePageCacheImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/LivePageCacheImpl.java	2012-01-09 11:17:17 UTC (rev 11999)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/LivePageCacheImpl.java	2012-01-09 11:17:36 UTC (rev 12000)
@@ -33,22 +33,24 @@
    // Constants -----------------------------------------------------
 
    // Attributes ----------------------------------------------------
-   
+
    private final List<PagedMessage> messages = new LinkedList<PagedMessage>();
-   
+
    private final Page page;
-   
+
    private boolean isLive = true;
-   
+
+   @Override
    public String toString()
    {
-      return "LivePacheCacheImpl::page=" + page.getPageId() + " number of messages=" + messages.size() + " isLive = " + isLive;
+      return "LivePacheCacheImpl::page=" + page.getPageId() + ", number of messages=" + messages.size() +
+               ", isLive = " + isLive;
    }
 
    // Static --------------------------------------------------------
 
    // Constructors --------------------------------------------------
-   
+
    public LivePageCacheImpl(final Page page)
    {
       this.page = page;
@@ -63,7 +65,7 @@
    {
       return page;
    }
-   
+
    public long getPageId()
    {
       return page.getPageId();
@@ -151,7 +153,7 @@
    /* (non-Javadoc)
     * @see org.hornetq.core.paging.cursor.PageCache#getMessages()
     */
-   public PagedMessage[] getMessages()
+   public synchronized PagedMessage[] getMessages()
    {
       return messages.toArray(new PagedMessage[messages.size()]);
    }



More information about the hornetq-commits mailing list