ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [21/35] ignite git commit: Fixed assertion in optimized marshaller
Date Fri, 26 Feb 2016 13:16:39 GMT
Fixed assertion in optimized marshaller


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

Branch: refs/heads/ignite-2407
Commit: 91177201c808c6e48b94e8ad81a77b50db7e1298
Parents: faa77e2
Author: Valentin Kulichenko <valentin.kulichenko@gmail.com>
Authored: Wed Feb 24 16:06:03 2016 -0800
Committer: Valentin Kulichenko <valentin.kulichenko@gmail.com>
Committed: Wed Feb 24 16:06:03 2016 -0800

----------------------------------------------------------------------
 .../marshaller/optimized/OptimizedObjectStreamRegistry.java  | 8 ++------
 .../optimized/OptimizedMarshallerPooledSelfTest.java         | 8 ++++++++
 2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/91177201/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectStreamRegistry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectStreamRegistry.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectStreamRegistry.java
index 8fde4c3..cf92d27 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectStreamRegistry.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectStreamRegistry.java
@@ -92,9 +92,7 @@ class OptimizedObjectStreamRegistry {
 
         StreamHolder holder = holders.get();
 
-        assert holder != null;
-
-        if (holder.releaseOut() && pool != null) {
+        if (holder != null && holder.releaseOut() && pool != null) {
             holders.set(null);
 
             boolean b = pool.offer(holder);
@@ -114,9 +112,7 @@ class OptimizedObjectStreamRegistry {
 
         StreamHolder holder = holders.get();
 
-        assert holder != null;
-
-        if (holder.releaseIn() && pool != null) {
+        if (holder != null && holder.releaseIn() && pool != null) {
             holders.set(null);
 
             boolean b = pool.offer(holder);

http://git-wip-us.apache.org/repos/asf/ignite/blob/91177201/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerPooledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerPooledSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerPooledSelfTest.java
index fc77029..c649787 100644
--- a/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerPooledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/marshaller/optimized/OptimizedMarshallerPooledSelfTest.java
@@ -33,4 +33,12 @@ public class OptimizedMarshallerPooledSelfTest extends OptimizedMarshallerSelfTe
 
         return m;
     }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        // Reset static registry.
+        new OptimizedMarshaller().setPoolSize(-1);
+    }
 }


Mime
View raw message