diff --git a/src/com/amarsoft/app/util/ProductParamUtil.java b/src/com/amarsoft/app/util/ProductParamUtil.java index 5a35f265d..cb03b8468 100644 --- a/src/com/amarsoft/app/util/ProductParamUtil.java +++ b/src/com/amarsoft/app/util/ProductParamUtil.java @@ -13,6 +13,7 @@ import net.sf.json.JSONArray; import net.sf.json.JSONNull; import net.sf.json.JSONObject; +import org.apache.commons.lang3.StringUtils; import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.io.OutputFormat; @@ -273,14 +274,14 @@ public class ProductParamUtil { String pData = boLPI.getAttribute("PRODUCT_DATA").getString();*/ String pData = ProductConfig.getProductData(realXmlPath); String type = componentType; - if("".equals(pData)){ + if(StringUtils.isEmpty(pData)){ }else{ JSONArray jsonArray = JSONArray.fromObject(pData); Iterator it = jsonArray.iterator(); JSONArray docList = null; JSONArray docGroupConfig = null; while(it.hasNext()){ - JSONObject jo = (JSONObject)it.next().get("jbo.sample.Component"); + JSONObject jo = it.next().getJSONObject("jbo.sample.Component"); if(type.equals(jo.get("TYPE"))){ docList = JSONArray.fromObject(jo.get("DecisionTable")); } @@ -483,13 +484,13 @@ public class ProductParamUtil { String pData = boLPI.getAttribute("PRODUCT_DATA").getString();*/ String pData = ProductConfig.getProductData(realXmlPath); String type = componentType; - if("".equals(pData)){ + if(StringUtils.isEmpty(pData)){ }else{ JSONArray jsonArray = JSONArray.fromObject(pData); Iterator it = jsonArray.iterator(); JSONArray param = null; while(it.hasNext()){ - JSONObject jo = (JSONObject)it.next().get("jbo.sample.Component"); + JSONObject jo = it.next().getJSONObject("jbo.sample.Component"); if(type.equals(jo.get("TYPE")) && id.equals(jo.get("ID"))){ param = JSONArray.fromObject(jo.get("Parameter")); } @@ -686,12 +687,12 @@ public class ProductParamUtil { //Çл»¶ÁÈ¡»º´æ String pData = ProductConfig.getProductData(realXmlPath); String type = componentType; - if("".equals(pData)){ + if(StringUtils.isEmpty(pData)){ }else{ JSONArray jsonArray = JSONArray.fromObject(pData); Iterator it = jsonArray.iterator(); while(it.hasNext()){ - JSONObject jo = (JSONObject)it.next().get("jbo.sample.Component"); + JSONObject jo = it.next().getJSONObject("jbo.sample.Component"); if(type.equals(jo.get("TYPE"))){ JSONArray ja = JSONArray.fromObject(jo.get("Parameter")); BusinessObject b = BusinessObject.createBusinessObject("Component"); @@ -724,12 +725,12 @@ public class ProductParamUtil { String pData = boLPI.getAttribute("PRODUCT_DATA").getString();*/ String pData = ProductConfig.getProductData(realXmlPath); String type = componentType; - if("".equals(pData)){ + if(StringUtils.isEmpty(pData)){ }else{ JSONArray jsonArray = JSONArray.fromObject(pData); Iterator it = jsonArray.iterator(); while(it.hasNext()){ - JSONObject jo = (JSONObject)it.next().get("jbo.sample.Component"); + JSONObject jo = it.next().getJSONObject("jbo.sample.Component"); if(type.equals(jo.get("TYPE"))){ JSONArray ja = JSONArray.fromObject(jo.get("DecisionTable")); BusinessObject b = BusinessObject.createBusinessObject("Component");