ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [2/2] ignite git commit: IGNITE-843 refactored toString() in POJO java code generation.
Date Thu, 18 Feb 2016 13:41:21 GMT
IGNITE-843 refactored toString() in POJO java code generation.


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

Branch: refs/heads/ignite-843-rc2
Commit: 695c217b74ba9c12170f56ca17ca72915b4ccb05
Parents: 6a9ced4
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Thu Feb 18 20:41:17 2016 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Thu Feb 18 20:41:17 2016 +0700

----------------------------------------------------------------------
 .../src/main/js/helpers/generator/generator-java.js       | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/695c217b/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 08e88c6..abee0be 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
@@ -2073,15 +2073,13 @@ $generatorJava.javaClassCode = function (domain, key, pkg, useConstructor,
inclu
     res.line('/** {@inheritDoc} */');
     res.startBlock('@Override public String toString() {');
 
+    res.startBlock('return \"' + type + ' [" + ');
+
     _.forEach(allFields, function (field, idx) {
-        if (idx === 0)
-            res.startBlock('return \"' + type + ' [' + field.javaFieldName + '=\" + ' + field.javaFieldName
+ ' +', type);
-        else
-            res.line('\", ' + field.javaFieldName + '=\" + ' + field.javaFieldName + ' +');
+        res.line('\"' + field.javaFieldName + '=\" + ' + field.javaFieldName + (idx <
allFields.length - 1 ? ' + ", " + ' : ' +'));
     });
 
-    res.line('"]";');
-    res.endBlock();
+    res.endBlock('"]";');
     res.endBlock('}');
 
     res.endBlock('}');


Mime
View raw message