ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-843 Tweak diff selection.
Date Tue, 22 Sep 2015 10:06:54 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 efa48db4f -> b1e309171


IGNITE-843 Tweak diff selection.


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

Branch: refs/heads/ignite-843
Commit: b1e309171e2b7f1d10f51b16f1b45ba723f511df
Parents: efa48db
Author: vsisko <vsisko@gridgain.com>
Authored: Tue Sep 22 17:06:55 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Tue Sep 22 17:06:55 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/common-module.js        |  6 +++++-
 .../src/main/js/routes/generator/generator-java.js  | 16 ++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b1e30917/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index bb4d809..4d21341 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -1342,6 +1342,8 @@ controlCenterModule.service('$preview', ['$timeout', '$interval', function
($tim
             var prevLen = prevContent.length - (prevContent[prevContent.length - 1] == ''
? 1 : 0);
             var newLen = newContent.length - (newContent[newContent.length - 1] == '' ? 1
: 0);
 
+            var removed = newLen < prevLen;
+
             var skipEnd = 0;
 
             var selected = false;
@@ -1390,7 +1392,9 @@ controlCenterModule.service('$preview', ['$timeout', '$interval', function
($tim
                     }
 
                     if (start == end) {
-                        start = Math.max(0, start - 1);
+                        if (removed)
+                            start = Math.max(0, start - 1);
+
                         end = Math.min(newLen + skipEnd, end + 1)
                     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b1e30917/modules/control-center-web/src/main/js/routes/generator/generator-java.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-java.js b/modules/control-center-web/src/main/js/routes/generator/generator-java.js
index 4b1e68b..880e159 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-java.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-java.js
@@ -180,16 +180,12 @@ $generatorJava.listProperty = function (res, varName, obj, propName,
dataType, s
 
         res.importClass('java.util.Arrays');
 
-        res.append(varName + '.' + $generatorJava.setterName(propName, setterName) + '(Arrays.asList(');
-
-        for (var i = 0; i < val.length; i++) {
-            if (i > 0)
-                res.append(', ');
-
-            res.append($generatorJava.toJavaCode(val[i], dataType));
-        }
-
-        res.line('));');
+        res.line(varName + '.' + $generatorJava.setterName(propName, setterName) +
+            '(Arrays.asList(' +
+                _.map(val, function (v) {
+                    return $generatorJava.toJavaCode(v, dataType)
+                }).join(', ') +
+            '));');
 
         res.needEmptyLine = true;
     }


Mime
View raw message