ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [3/3] ignite git commit: IGNITE-843 Generator fixes.
Date Tue, 26 Jan 2016 11:08:45 GMT
IGNITE-843 Generator fixes.


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

Branch: refs/heads/ignite-843-rc3
Commit: 1dccb656dbbde5f3f8763904037fba790e3e187c
Parents: ec0f914
Author: Vasiliy Sisko <vsisko@gridgain.com>
Authored: Tue Jan 26 18:06:04 2016 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Tue Jan 26 18:06:04 2016 +0700

----------------------------------------------------------------------
 .../main/js/helpers/generator/generator-java.js |  2 +-
 .../main/js/helpers/generator/generator-xml.js  | 22 +++++++++++++++-----
 2 files changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1dccb656/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 abb2b4a..fefc6d1 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
@@ -320,7 +320,7 @@ $generatorJava.beanProperty = function (res, varName, bean, beanPropName,
beanVa
                             break;
 
                         case 'enum':
-                            $generatorJava.property(res, beanVarName, bean, propName, descr.enumClass,
descr.setterName);
+                            $generatorJava.property(res, beanVarName, bean, propName, descr.enumClass,
descr.setterName, descr.dflt);
                             break;
 
                         case 'float':

http://git-wip-us.apache.org/repos/asf/ignite/blob/1dccb656/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js b/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
index a4925cf..67024c9 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
@@ -143,10 +143,15 @@ $generatorXml.beanProperty = function (res, bean, beanPropName, desc,
createBean
     var props = desc.fields;
 
     if (bean && $commonUtils.hasProperty(bean, props)) {
-        res.startSafeBlock();
+        if (!createBeanAlthoughNoProps)
+            res.startSafeBlock();
 
         res.emptyLineIfNeeded();
         res.startBlock('<property name="' + beanPropName + '">');
+
+        if (createBeanAlthoughNoProps)
+            res.startSafeBlock();
+
         res.startBlock('<bean class="' + desc.className + '">');
 
         var hasData = false;
@@ -211,16 +216,23 @@ $generatorXml.beanProperty = function (res, bean, beanPropName, desc,
createBean
         });
 
         res.endBlock('</bean>');
+
+        if (createBeanAlthoughNoProps && !hasData) {
+            res.rollbackSafeBlock();
+
+            res.line('<bean class="' + desc.className + '"/>');
+        }
+
         res.endBlock('</property>');
 
-        if (!hasData)
+        if (!createBeanAlthoughNoProps && !hasData)
             res.rollbackSafeBlock();
     }
     else if (createBeanAlthoughNoProps) {
         res.emptyLineIfNeeded();
-        res.line('<property name="' + beanPropName + '">');
-        res.line('    <bean class="' + desc.className + '"/>');
-        res.line('</property>');
+        res.startBlock('<property name="' + beanPropName + '">');
+        res.line('<bean class="' + desc.className + '"/>');
+        res.endBlock('</property>');
     }
 };
 


Mime
View raw message