ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [1/2] ignite git commit: IGNITE-843 Added declaration of array variable.
Date Wed, 09 Dec 2015 08:54:10 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc2 539f819c3 -> 31abbeb15


IGNITE-843 Added declaration of array variable.


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

Branch: refs/heads/ignite-843-rc2
Commit: 744ec6443167d4b858de066a461ffb274bfad6ab
Parents: da50f0c
Author: Vasiliy Sisko <vsisko@gridgain.com>
Authored: Wed Dec 9 15:54:07 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Wed Dec 9 15:54:07 2015 +0700

----------------------------------------------------------------------
 .../main/js/helpers/generator/generator-java.js | 21 ++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/744ec644/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-java.js b/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
index 39f9c9e..f5714b4 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
@@ -119,6 +119,27 @@ $generatorJava.declareVariableCustom = function (res, varName, varFullType,
varE
 };
 
 /**
+ * Add array variable declaration.
+ *
+ * @param res Resulting output with generated code.
+ * @param varName Variable name.
+ * @param varFullType Variable full class name to be added to imports.
+ * @param length Array length.
+ */
+$generatorJava.declareVariableArray = function (res, varName, varFullType, length) {
+    var varType = res.importClass(varFullType);
+
+    var varNew = !res.vars[varName];
+
+    if (varNew)
+        res.vars[varName] = true;
+
+    res.line((varNew ? (varType + '[] ') : '') + varName + ' = new ' + varType + '[' + length
+ '];');
+
+    res.needEmptyLine = true;
+};
+
+/**
  * Clear list of declared variables.
  *
  * @param res


Mime
View raw message