ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [30/50] incubator-ignite git commit: IGNITE-843 Reverted usage of addPropertyIfNotDefault.
Date Fri, 31 Jul 2015 07:47:12 GMT
IGNITE-843 Reverted usage of addPropertyIfNotDefault.


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

Branch: refs/heads/ignite-1155_1
Commit: 5b111c770e3cbff191bff6478bc13ee00f84f0ce
Parents: ae32685
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Thu Jul 30 23:41:03 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Thu Jul 30 23:41:03 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/routes/generator/java.js             | 15 ++-------------
 .../src/main/js/routes/generator/xml.js              | 13 +++----------
 2 files changed, 5 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5b111c77/modules/control-center-web/src/main/js/routes/generator/java.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/java.js b/modules/control-center-web/src/main/js/routes/generator/java.js
index ba253e0..d24f16c 100644
--- a/modules/control-center-web/src/main/js/routes/generator/java.js
+++ b/modules/control-center-web/src/main/js/routes/generator/java.js
@@ -479,15 +479,15 @@ function addCacheConfiguration(res, cache, varName) {
     if (cacheMode == 'PARTITIONED')
         addProperty(res, varName, cache, 'backups');
 
+    addProperty(res, varName, cache, 'readFromBackup', true);
     addProperty(res, varName, cache, 'startSize');
-    addPropertyIfNotDefault(res, varName, cache, 'readFromBackup', true);
 
     res.needEmptyLine = true;
 
     addProperty(res, varName, cache, 'memoryMode', 'CacheMemoryMode');
     addProperty(res, varName, cache, 'offHeapMaxMemory');
     addProperty(res, varName, cache, 'swapEnabled');
-    addPropertyIfNotDefault(res, varName, cache, 'copyOnRead', true);
+    addProperty(res, varName, cache, 'copyOnRead', true);
 
     res.needEmptyLine = true;
 
@@ -725,17 +725,6 @@ function addProperty(res, varName, obj, propName, enumType, setterName)
{
     return val;
 }
 
-function addPropertyIfNotDefault(res, varName, obj, propName, dflt) {
-    var val = obj[propName];
-
-    if (generatorUtils.isDefined(val) && val != dflt) {
-        res.emptyLineIfNeeded();
-
-        res.line(varName + '.' + getSetterName(propName)
-            + '(' + toJavaCode(val) + ');');
-    }
-}
-
 /**
  * Add property via setter assuming that it is a 'Class'.
  *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5b111c77/modules/control-center-web/src/main/js/routes/generator/xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/xml.js b/modules/control-center-web/src/main/js/routes/generator/xml.js
index 9a893a6..3555d2e 100644
--- a/modules/control-center-web/src/main/js/routes/generator/xml.js
+++ b/modules/control-center-web/src/main/js/routes/generator/xml.js
@@ -464,16 +464,16 @@ function generateCacheConfiguration(res, cacheCfg) {
     if (cacheMode == 'PARTITIONED')
         addProperty(res, cacheCfg, 'backups');
 
-    addProperty(res, cacheCfg, 'startSize');
+    addProperty(res, cacheCfg, 'readFromBackup', true);
 
-    addPropertyIfNotDefault(res, cacheCfg, 'readFromBackup', true);
+    addProperty(res, cacheCfg, 'startSize');
 
     res.needEmptyLine = true;
 
     addProperty(res, cacheCfg, 'memoryMode');
     addProperty(res, cacheCfg, 'offHeapMaxMemory');
     addProperty(res, cacheCfg, 'swapEnabled');
-    addPropertyIfNotDefault(res, cacheCfg, 'copyOnRead', true);
+    addProperty(res, cacheCfg, 'copyOnRead', true);
 
     res.needEmptyLine = true;
 
@@ -646,13 +646,6 @@ function addProperty(res, obj, propName, setterName) {
     return val;
 }
 
-function addPropertyIfNotDefault(res, obj, propName, dflt) {
-    var val = obj[propName];
-
-    if (generatorUtils.isDefined(val) && val != dflt)
-        addElement(res, 'property', 'name', propName, 'value', escapeAttr(val));
-}
-
 function addBeanWithProperties(res, bean, beanPropName, beanClass, props, createBeanAlthoughNoProps)
{
     if (bean && generatorUtils.hasProperty(bean, props)) {
         res.emptyLineIfNeeded();


Mime
View raw message