ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [2/3] incubator-ignite git commit: # IGNITE-843 Bug fix: event list generats incorrectly. (java)
Date Thu, 25 Jun 2015 08:41:20 GMT
# IGNITE-843 Bug fix: event list generats incorrectly. (java)


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

Branch: refs/heads/ignite-843
Commit: 55330e99144e6aa363729f67f7a3110e34c8278f
Parents: fc16dea
Author: sevdokimov <sergey.evdokimov@jetbrains.com>
Authored: Thu Jun 25 11:38:51 2015 +0300
Committer: sevdokimov <sergey.evdokimov@jetbrains.com>
Committed: Thu Jun 25 11:38:51 2015 +0300

----------------------------------------------------------------------
 modules/webconfig/nodejs/utils/generatorJava.js | 35 +++++++++++++++++++-
 modules/webconfig/nodejs/utils/generatorXml.js  |  3 ++
 2 files changed, 37 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55330e99/modules/webconfig/nodejs/utils/generatorJava.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/utils/generatorJava.js b/modules/webconfig/nodejs/utils/generatorJava.js
index 1219218..2ba8e02 100644
--- a/modules/webconfig/nodejs/utils/generatorJava.js
+++ b/modules/webconfig/nodejs/utils/generatorJava.js
@@ -161,7 +161,40 @@ exports.generateClusterConfiguration = function(cluster) {
 
     res.needEmptyLine = true;
 
-    addMultiparamProperty(res, cluster, 'cfg', 'includeEventTypes', 'EventType');
+    if (cluster.includeEventTypes && cluster.includeEventTypes.length > 0) {
+        res.emptyLineIfNeeded();
+        
+        if (cluster.includeEventTypes.length == 1) {
+            res.line('cfg.setIncludeEventTypes(EventType.' + cluster.includeEventTypes[0]
+ ');');
+        }
+        else {
+            res.append('int[] events = new int[EventType.' + cluster.includeEventTypes[0]
+ '.length');
+            
+            for (i = 1; i < cluster.includeEventTypes.length; i++) {
+                res.line();
+                
+                res.append('    + EventType.' + cluster.includeEventTypes[i] + '.length');
+            }
+            
+            res.line('];');
+            res.line();
+            res.line('int k = 0;');
+
+            for (i = 0; i < cluster.includeEventTypes.length; i++) {
+                res.line();
+
+                var e = cluster.includeEventTypes[i];
+                
+                res.line('System.arraycopy(EventType.' + e + ', 0, events, k, EventType.'
+ e + '.length);');
+                res.line('k += EventType.' + e + '.length;');
+            }
+            
+            res.line();
+            res.line('cfg.setIncludeEventTypes(events);');
+        }
+
+        res.needEmptyLine = true;
+    }
 
     res.needEmptyLine = true;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55330e99/modules/webconfig/nodejs/utils/generatorXml.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/utils/generatorXml.js b/modules/webconfig/nodejs/utils/generatorXml.js
index db92c5c..6655998 100644
--- a/modules/webconfig/nodejs/utils/generatorXml.js
+++ b/modules/webconfig/nodejs/utils/generatorXml.js
@@ -156,7 +156,10 @@ exports.generateClusterConfiguration = function(cluster) {
     }
 
     if (cluster.includeEventTypes && cluster.includeEventTypes.length > 0) {
+        res.emptyLineIfNeeded();
+        
         res.startBlock('<property name="includeEventTypes">');
+        
         if (cluster.includeEventTypes.length == 1) {
             res.line('<util:constant static-field="org.apache.ignite.events.EventType.'
+ cluster.includeEventTypes[0] + '"/>')
         }


Mime
View raw message