activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From martyntay...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-490 Fixing new largeMessage copy
Date Wed, 20 Apr 2016 14:12:40 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master de0ac57aa -> 725379920


ARTEMIS-490 Fixing new largeMessage copy


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/b89faae4
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/b89faae4
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/b89faae4

Branch: refs/heads/master
Commit: b89faae45811454394233bf683d2ce17d373034a
Parents: de0ac57
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Wed Apr 20 09:51:44 2016 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Apr 20 10:08:29 2016 -0400

----------------------------------------------------------------------
 .../core/persistence/impl/journal/LargeServerMessageImpl.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b89faae4/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java
index 3f6f4d7..d85b17a 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/LargeServerMessageImpl.java
@@ -276,6 +276,10 @@ public final class LargeServerMessageImpl extends ServerMessageImpl implements
L
       try {
          LargeServerMessage newMessage = storageManager.createLargeMessage(newID, this);
 
+         boolean originallyOpen = file != null && file.isOpen();
+
+         validateFile();
+
 
          byte[] bufferBytes = new byte[100 * 1024];
 
@@ -283,7 +287,6 @@ public final class LargeServerMessageImpl extends ServerMessageImpl implements
L
 
          long oldPosition = file.position();
 
-         boolean originallyOpen = file.isOpen();
          file.open();
          file.position(0);
 
@@ -294,7 +297,7 @@ public final class LargeServerMessageImpl extends ServerMessageImpl implements
L
             int bytesRead = file.read(buffer);
 
             byte[] bufferToWrite;
-            if (bytesRead == 0) {
+            if (bytesRead <= 0) {
                break;
             }
             else if (bytesRead == bufferBytes.length) {


Mime
View raw message