From 2655b35b6a2bb1f503d2291ad40ed85a3628b8ae Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 26 Aug 2008 18:59:25 +0000 Subject: [PATCH] More fixing on this type of error strings using "==" --- base/src/org/compiere/FA/AssetDisposed.java | 2 +- base/src/org/compiere/FA/AssetRevalEntry.java | 16 ++++++++-------- base/src/org/compiere/FA/CalloutFA.java | 6 +++--- base/src/org/compiere/util/WebDoc.java | 2 +- .../posterita/businesslogic/LoginManager.java | 2 +- .../org/posterita/businesslogic/POSManager.java | 2 +- .../core/businesslogic/ElementManager.java | 4 ++-- .../struts/pos/CustomPOSReportAction.java | 4 ++-- .../org/posterita/struts/pos/POSInfoAction.java | 4 ++-- .../org/posterita/struts/pos/POSOrderAction.java | 4 ++-- .../posterita/struts/pos/POSReportAction.java | 4 ++-- .../struts/pos/POSSalesReportAction.java | 4 ++-- .../struts/pos/PartialPOSOrderAction.java | 4 ++-- .../struts/pos/StockMovementReportAction.java | 4 ++-- .../org/adempiere/webui/apps/form/WMerge.java | 8 ++++---- 15 files changed, 35 insertions(+), 35 deletions(-) diff --git a/base/src/org/compiere/FA/AssetDisposed.java b/base/src/org/compiere/FA/AssetDisposed.java index 8d2620eb89..affdee2706 100644 --- a/base/src/org/compiere/FA/AssetDisposed.java +++ b/base/src/org/compiere/FA/AssetDisposed.java @@ -111,7 +111,7 @@ public class AssetDisposed extends SvrProcess try { rs = pstmt.executeQuery(); while (rs.next()){ - if (v_PostingType != rs.getString("PostingType") & v_PostingType != null) + if (v_PostingType != null && (!v_PostingType.equals(rs.getString("PostingType")))) { sql = "UPDATE A_DEPRECIATION_WORKFILE " + "SET A_ACCUMULATED_DEPR = " + v_Balance diff --git a/base/src/org/compiere/FA/AssetRevalEntry.java b/base/src/org/compiere/FA/AssetRevalEntry.java index 016f77842c..a05bb76f77 100644 --- a/base/src/org/compiere/FA/AssetRevalEntry.java +++ b/base/src/org/compiere/FA/AssetRevalEntry.java @@ -127,24 +127,24 @@ public class AssetRevalEntry extends SvrProcess X_A_Asset_Reval_Index ARevalIndex = new X_A_Asset_Reval_Index (getCtx(), DB.getSQLValue(null ,sql), null); MAsset Asset = new MAsset (getCtx(), rs.getInt("A_Asset_ID"), null); - if (AssetReval.getA_Reval_Multiplier() == "IND") + if (AssetReval.getA_Reval_Multiplier().equals(X_A_Asset_Reval_Entry.A_REVAL_MULTIPLIER_Index)) { - if (AssetReval.getA_Reval_Effective_Date() == "DA"){ + if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_DateAquired)){ sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code() + " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < " + Asset.getA_Asset_CreateDate() + ")"; } - else if (AssetReval.getA_Reval_Effective_Date() == "RD"){ + else if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_RevaluationDate)){ sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code() + " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < " + Asset.getA_Asset_RevalDate() + ")"; } - else if (AssetReval.getA_Reval_Effective_Date() == "SD"){ + else if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_DateDepreciationStarted)){ sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code() + " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < " + Asset.getAssetServiceDate() @@ -269,25 +269,25 @@ public class AssetRevalEntry extends SvrProcess DB.close(rs, pstmt); rs = null; pstmt = null; } } - else if (AssetReval.getA_Reval_Multiplier() == "FAC") + else if (AssetReval.getA_Reval_Multiplier().equals(X_A_Asset_Reval_Entry.A_REVAL_MULTIPLIER_Factor)) { - if (AssetReval.getA_Reval_Effective_Date() == "DA"){ + if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_DateAquired)){ sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code() + " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < " + Asset.getA_Asset_CreateDate() + ")"; } - else if (AssetReval.getA_Reval_Effective_Date() == "RD"){ + else if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_RevaluationDate)){ sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code() + " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < " + Asset.getA_Asset_RevalDate() + ")"; } - else if (AssetReval.getA_Reval_Effective_Date() == "SD"){ + else if (AssetReval.getA_Reval_Effective_Date().equals(X_A_Asset_Reval_Entry.A_REVAL_EFFECTIVE_DATE_DateDepreciationStarted)){ sql2 = "Select A_REVAL_MULTIPLIER from A_ASSET_REVAL_INDEX where A_REVAL_CODE = " + AssetReval.getA_Rev_Code() + " and A_EFFECTIVE_DATE = (select MAX(A_EFFECTIVE_DATE) from A_ASSET_REVAL_INDEX where A_EFFECTIVE_DATE < " + Asset.getAssetServiceDate() diff --git a/base/src/org/compiere/FA/CalloutFA.java b/base/src/org/compiere/FA/CalloutFA.java index 9426834973..5f8f4a8b0a 100644 --- a/base/src/org/compiere/FA/CalloutFA.java +++ b/base/src/org/compiere/FA/CalloutFA.java @@ -112,18 +112,18 @@ public class CalloutFA extends CalloutEngine if (rs.next()) { // Charges - Set Context - if (rs.getString("DepreciationType")!= "TAB" | rs.getString("DepreciationType")!= "MAN") + if ( (!rs.getString("DepreciationType").equals("TAB")) || (!rs.getString("DepreciationType").equals("MAN")) ) { Env.setContext(ctx, WindowNo, "A_DEPRECIATION_MANUAL_PERIOD", ""); //mTab.setValue ("A_Depreciation_Manual_Period", null); mTab.setValue ("A_Depreciation_Manual_Amount", null); mTab.setValue ("A_Depreciation_Table_Header_ID", null); } - if (rs.getString("DepreciationType")== "TAB") + if (rs.getString("DepreciationType").equals("TAB")) { mTab.setValue ("A_Depreciation_Manual_Amount", null); } - if (rs.getString("DepreciationType")== "MAN") + if (rs.getString("DepreciationType").equals("MAN")) { mTab.setValue ("A_Depreciation_Table_Header_ID", null); } diff --git a/base/src/org/compiere/util/WebDoc.java b/base/src/org/compiere/util/WebDoc.java index 7c3efc8352..de4108f6cd 100644 --- a/base/src/org/compiere/util/WebDoc.java +++ b/base/src/org/compiere/util/WebDoc.java @@ -173,7 +173,7 @@ public class WebDoc m_topRight.addElement(new img("http://www.adempiere.com/images/adempiere64x32.png") .setAlign(AlignType.RIGHT).setAlt("Adempiere Inc.")); else - if(title == "") + if(title.equals("")) m_topRight.addElement(WebEnv.getLogo()); else m_topRight.addElement(new h1(title)); diff --git a/posterita/src/main/org/posterita/businesslogic/LoginManager.java b/posterita/src/main/org/posterita/businesslogic/LoginManager.java index 1ddba366b5..1341c5f4f4 100644 --- a/posterita/src/main/org/posterita/businesslogic/LoginManager.java +++ b/posterita/src/main/org/posterita/businesslogic/LoginManager.java @@ -424,7 +424,7 @@ public class LoginManager // load Orgs while (rs.next()) { - if(orgIds=="") + if(orgIds.equals("")) orgIds = orgIds+rs.getInt(1)+""; else orgIds = orgIds+","+rs.getInt(1)+""; diff --git a/posterita/src/main/org/posterita/businesslogic/POSManager.java b/posterita/src/main/org/posterita/businesslogic/POSManager.java index f4c66dd52a..e581cbea86 100644 --- a/posterita/src/main/org/posterita/businesslogic/POSManager.java +++ b/posterita/src/main/org/posterita/businesslogic/POSManager.java @@ -161,7 +161,7 @@ public class POSManager for(String discount : discounts) { - if( discount == null || discount == "" ) + if( discount == null || discount.equals("") ) { discount = "0.0"; } diff --git a/posterita/src/main/org/posterita/core/businesslogic/ElementManager.java b/posterita/src/main/org/posterita/core/businesslogic/ElementManager.java index 5336bd0c3b..27db3c01c4 100644 --- a/posterita/src/main/org/posterita/core/businesslogic/ElementManager.java +++ b/posterita/src/main/org/posterita/core/businesslogic/ElementManager.java @@ -191,12 +191,12 @@ public class ElementManager String msg = Msg.getElement(language, text, true); - if (msg == null || msg == "") + if (msg == null || msg.equals("")) { msg = Msg.translate(language, text); } - if (msg == null || msg == "") + if (msg == null || msg.equals("")) { msg = text; } diff --git a/posterita/src/main/org/posterita/struts/pos/CustomPOSReportAction.java b/posterita/src/main/org/posterita/struts/pos/CustomPOSReportAction.java index 51b51ca2dd..b7154c198d 100644 --- a/posterita/src/main/org/posterita/struts/pos/CustomPOSReportAction.java +++ b/posterita/src/main/org/posterita/struts/pos/CustomPOSReportAction.java @@ -329,14 +329,14 @@ public class CustomPOSReportAction extends POSDispatchAction else if(dateRange.endsWith(Constants.CUSTOM_DATE_RANGE)) { - if((fromDate == null)||(fromDate == "")) + if((fromDate == null)||(fromDate.equals(""))) { message = new ActionMessage("error.required.fromDate"); messages.add(ActionMessages.GLOBAL_MESSAGE, message); error = true; } - if((toDate == null)||(toDate == "")) + if((toDate == null)||(toDate.equals(""))) { message = new ActionMessage("error.required.toDate"); messages.add(ActionMessages.GLOBAL_MESSAGE, message); diff --git a/posterita/src/main/org/posterita/struts/pos/POSInfoAction.java b/posterita/src/main/org/posterita/struts/pos/POSInfoAction.java index edcb75fb8a..4428f24b58 100644 --- a/posterita/src/main/org/posterita/struts/pos/POSInfoAction.java +++ b/posterita/src/main/org/posterita/struts/pos/POSInfoAction.java @@ -157,14 +157,14 @@ public class POSInfoAction extends POSDispatchAction ActionMessage message = null; - if((bean.getFromDate()==null)||(bean.getFromDate()=="")) + if((bean.getFromDate()==null)||(bean.getFromDate().equals(""))) { message = new ActionMessage("error.required.fromDate"); messages.add(ActionMessages.GLOBAL_MESSAGE, message); error = true; } - if((bean.getToDate()==null)||(bean.getToDate()=="")) + if((bean.getToDate()==null)||(bean.getToDate().equals(""))) { message = new ActionMessage("error.required.toDate"); messages.add(ActionMessages.GLOBAL_MESSAGE, message); diff --git a/posterita/src/main/org/posterita/struts/pos/POSOrderAction.java b/posterita/src/main/org/posterita/struts/pos/POSOrderAction.java index 24e8939bf9..385e383d8c 100644 --- a/posterita/src/main/org/posterita/struts/pos/POSOrderAction.java +++ b/posterita/src/main/org/posterita/struts/pos/POSOrderAction.java @@ -129,7 +129,7 @@ public class POSOrderAction extends POSDispatchAction { for(String s : discountPercentage) { - if(s == null || s == "") + if(s == null || s.equals("")) { continue; } @@ -153,7 +153,7 @@ public class POSOrderAction extends POSDispatchAction for(String s : actualPrice) { - if(s == null || s == "") + if(s == null || s.equals("")) { continue; } diff --git a/posterita/src/main/org/posterita/struts/pos/POSReportAction.java b/posterita/src/main/org/posterita/struts/pos/POSReportAction.java index 1ed4a9d829..595123993d 100644 --- a/posterita/src/main/org/posterita/struts/pos/POSReportAction.java +++ b/posterita/src/main/org/posterita/struts/pos/POSReportAction.java @@ -245,14 +245,14 @@ public class POSReportAction extends BaseDispatchAction ActionMessage message = null; - if((bean.getFromDate()==null)||(bean.getFromDate()=="")) + if((bean.getFromDate()==null)||(bean.getFromDate().equals(""))) { message = new ActionMessage("error.required.fromDate"); messages.add(ActionMessages.GLOBAL_MESSAGE, message); error = true; } - if((bean.getToDate()==null)||(bean.getToDate()=="")) + if((bean.getToDate()==null)||(bean.getToDate().equals(""))) { message = new ActionMessage("error.required.toDate"); messages.add(ActionMessages.GLOBAL_MESSAGE, message); diff --git a/posterita/src/main/org/posterita/struts/pos/POSSalesReportAction.java b/posterita/src/main/org/posterita/struts/pos/POSSalesReportAction.java index 892371ac31..ab12b1ac56 100644 --- a/posterita/src/main/org/posterita/struts/pos/POSSalesReportAction.java +++ b/posterita/src/main/org/posterita/struts/pos/POSSalesReportAction.java @@ -197,13 +197,13 @@ public class POSSalesReportAction extends POSDispatchAction boolean error = false; - if((salesReportForm.getFromDate()==null)||(salesReportForm.getFromDate()=="")) + if((salesReportForm.getFromDate()==null)||(salesReportForm.getFromDate().equals(""))) { postGlobalError("error.required.startDate",request); error = true; } - if((salesReportForm.getToDate()==null)||(salesReportForm.getToDate()=="")) + if((salesReportForm.getToDate()==null)||(salesReportForm.getToDate().equals(""))) { postGlobalError("error.required.endDate",request); error = true; diff --git a/posterita/src/main/org/posterita/struts/pos/PartialPOSOrderAction.java b/posterita/src/main/org/posterita/struts/pos/PartialPOSOrderAction.java index c8521fa167..8926f31f19 100644 --- a/posterita/src/main/org/posterita/struts/pos/PartialPOSOrderAction.java +++ b/posterita/src/main/org/posterita/struts/pos/PartialPOSOrderAction.java @@ -553,7 +553,7 @@ public class PartialPOSOrderAction extends POSDispatchAction for(String s : discountPercentage) { - if(s == null || s == "") + if(s == null || s.equals("")) { continue; } @@ -571,7 +571,7 @@ public class PartialPOSOrderAction extends POSDispatchAction for(String s : actualPrice) { - if(s == null || s == "") + if(s == null || s.equals("")) { continue; } diff --git a/posterita/src/main/org/posterita/struts/pos/StockMovementReportAction.java b/posterita/src/main/org/posterita/struts/pos/StockMovementReportAction.java index 68efd84887..52ccaf20c2 100644 --- a/posterita/src/main/org/posterita/struts/pos/StockMovementReportAction.java +++ b/posterita/src/main/org/posterita/struts/pos/StockMovementReportAction.java @@ -156,14 +156,14 @@ public class StockMovementReportAction extends POSDispatchAction ActionMessages messages = new ActionMessages(); ActionMessage message = null; - if((bean.getFromDate()==null)||(bean.getFromDate()=="")) + if((bean.getFromDate()==null)||(bean.getFromDate().equals(""))) { message = new ActionMessage("error.required.fromDate"); messages.add(ActionMessages.GLOBAL_MESSAGE, message); error = true; } - if((bean.getToDate()==null)||(bean.getToDate()=="")) + if((bean.getToDate()==null)||(bean.getToDate().equals(""))) { message = new ActionMessage("error.required.toDate"); messages.add(ActionMessages.GLOBAL_MESSAGE, message); diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/form/WMerge.java b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/form/WMerge.java index 51062cb810..4544028022 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/form/WMerge.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/form/WMerge.java @@ -217,7 +217,7 @@ public class WMerge extends ADForm implements EventListener, ValueChangeListener if (name.equals("AD_Org_ID")) { - if (des == "from") + if (des.equals("from")) { from[0].setValue(value); fromIDs[0] = ((Integer)value).intValue(); @@ -230,7 +230,7 @@ public class WMerge extends ADForm implements EventListener, ValueChangeListener } else if (name.equals("C_BPartner_ID")) { - if (des == "from") + if (des.equals("from")) { from[1].setValue(value); fromIDs[1] = ((Integer)value).intValue(); @@ -243,7 +243,7 @@ public class WMerge extends ADForm implements EventListener, ValueChangeListener } else if (name.equals("M_Product_ID")) { - if (des == "from") + if (des.equals("from")) { from[3].setValue(value); fromIDs[3] = ((Integer)value).intValue(); @@ -256,7 +256,7 @@ public class WMerge extends ADForm implements EventListener, ValueChangeListener } else if (name.equals("AD_User_ID")) { - if (des == "from") + if (des.equals("from")) { from[2].setValue(value); fromIDs[2] = ((Integer)value).intValue();