[hornetq-commits] JBoss hornetq SVN: r11389 - branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7242/src/main/org/hornetq/core/paging/cursor.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Sep 21 15:07:57 EDT 2011
Author: clebert.suconic at jboss.com
Date: 2011-09-21 15:07:57 -0400 (Wed, 21 Sep 2011)
New Revision: 11389
Modified:
branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7242/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java
Log:
JBPAPP-7242 - Back porting HORNETQ-765 - test fix
Modified: branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7242/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java
===================================================================
--- branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7242/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java 2011-09-21 19:04:06 UTC (rev 11388)
+++ branches/one-offs/HornetQ_2_2_5_EAP_GA_JBPAPP_7242/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java 2011-09-21 19:07:57 UTC (rev 11389)
@@ -86,7 +86,15 @@
final PageSubscription subscription)
{
this.position = position;
- this.messageEstimate = message.getMessage().getMemoryEstimate();
+
+ if (message == null)
+ {
+ this.messageEstimate = -1;
+ }
+ else
+ {
+ this.messageEstimate = message.getMessage().getMemoryEstimate();
+ }
this.message = new WeakReference<PagedMessage>(message);
this.subscription = subscription;
}
@@ -112,6 +120,10 @@
*/
public int getMessageMemoryEstimate()
{
+ if (messageEstimate < 0)
+ {
+ messageEstimate = getMessage().getMemoryEstimate();
+ }
return messageEstimate;
}
More information about the hornetq-commits
mailing list