ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [02/50] ignite git commit: IGNITE-1265 - Corrected assertion in marshaller cache.
Date Tue, 25 Aug 2015 08:57:09 GMT
IGNITE-1265 - Corrected assertion in marshaller cache.


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

Branch: refs/heads/ignite-1093
Commit: d384d2901250f64e470feda9e4b34763b9420976
Parents: 0041737
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Wed Aug 19 11:47:19 2015 -0700
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Wed Aug 19 11:47:19 2015 -0700

----------------------------------------------------------------------
 .../ignite/internal/MarshallerContextImpl.java  | 22 ++++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d384d290/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
index 9f7c983..87bd3b6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal;
 
 import org.apache.ignite.*;
 import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.plugin.*;
 
@@ -177,18 +178,21 @@ public class MarshallerContextImpl extends MarshallerContextAdapter
{
         @Override public void onUpdated(Iterable<CacheEntryEvent<? extends Integer,
? extends String>> events)
             throws CacheEntryListenerException {
             for (CacheEntryEvent<? extends Integer, ? extends String> evt : events)
{
-                assert evt.getOldValue() == null : "Received non-null old value for system
marshaller cache: " + evt;
+                assert evt.getOldValue() == null || F.eq(evt.getOldValue(), evt.getValue()):
+                    "Received cache entry update for system marshaller cache: " + evt;
 
-                File file = new File(workDir, evt.getKey() + ".classname");
+                if (evt.getOldValue() == null) {
+                    File file = new File(workDir, evt.getKey() + ".classname");
 
-                try (Writer writer = new FileWriter(file)) {
-                    writer.write(evt.getValue());
+                    try (Writer writer = new FileWriter(file)) {
+                        writer.write(evt.getValue());
 
-                    writer.flush();
-                }
-                catch (IOException e) {
-                    U.error(log, "Failed to write class name to file [id=" + evt.getKey()
+
-                        ", clsName=" + evt.getValue() + ", file=" + file.getAbsolutePath()
+ ']', e);
+                        writer.flush();
+                    }
+                    catch (IOException e) {
+                        U.error(log, "Failed to write class name to file [id=" + evt.getKey()
+
+                            ", clsName=" + evt.getValue() + ", file=" + file.getAbsolutePath()
+ ']', e);
+                    }
                 }
             }
         }


Mime
View raw message