IDEMPIERE-455 Discover and fix FindBugs problems / Thanks to Richard Morales
This commit is contained in:
parent
ff9384f32e
commit
d1df4c45c8
|
@ -92,7 +92,7 @@ public class TaxNotFoundException extends AdempiereException
|
|||
return "?";
|
||||
}
|
||||
MLocation loc = MLocation.get(Env.getCtx(), C_Location_ID, null);
|
||||
if (loc == null | loc.get_ID() != C_Location_ID)
|
||||
if (loc == null || loc.get_ID() != C_Location_ID)
|
||||
{
|
||||
return "?";
|
||||
}
|
||||
|
|
|
@ -442,7 +442,7 @@ public class MAsset extends X_A_Asset
|
|||
MAssetGroupAcct assetgrpacct = new MAssetGroupAcct (getCtx(), rs, get_TrxName());
|
||||
MAssetAcct assetacct = new MAssetAcct (getCtx(), 0, get_TrxName());
|
||||
isdepreciate = assetgrpacct.isProcessing();
|
||||
if (isDepreciated()== true | isdepreciate == true)
|
||||
if (isDepreciated()== true || isdepreciate == true)
|
||||
{
|
||||
assetacct.setPostingType(assetgrpacct.getPostingType());
|
||||
assetacct.setA_Split_Percent(assetgrpacct.getA_Split_Percent());
|
||||
|
@ -454,7 +454,7 @@ public class MAsset extends X_A_Asset
|
|||
assetacct.setA_Period_Start(1);
|
||||
|
||||
|
||||
if (getUseLifeMonths() == 0 & getUseLifeYears() == 0){
|
||||
if (getUseLifeMonths() == 0 && getUseLifeYears() == 0){
|
||||
assetacct.setA_Period_End(assetgrpacct.getUseLifeMonths());
|
||||
asset.setUseLifeYears(assetgrpacct.getUseLifeYears());
|
||||
asset.setUseLifeMonths(assetgrpacct.getUseLifeMonths());
|
||||
|
@ -541,7 +541,7 @@ public class MAsset extends X_A_Asset
|
|||
if (DB.getSQLValue(get_TrxName(), sql2, asset.getA_Asset_ID(),assetgrpacct.getPostingType())== 0)
|
||||
{
|
||||
|
||||
if (isDepreciated()== true | isdepreciate == true)
|
||||
if (isDepreciated()== true || isdepreciate == true)
|
||||
{
|
||||
X_A_Depreciation_Workfile assetwk = new X_A_Depreciation_Workfile (getCtx(), 0, get_TrxName());
|
||||
assetwk.setA_Asset_ID(p_A_Asset_ID);
|
||||
|
|
|
@ -291,13 +291,13 @@ public class MWFProcess extends X_AD_WF_Process
|
|||
//
|
||||
if (closedState == null)
|
||||
closedState = activityWFState;
|
||||
else if (!closedState.equals(activityState))
|
||||
else if (!closedState.equals(activityState.getState()))
|
||||
{
|
||||
// Overwrite if terminated
|
||||
if (WFSTATE_Terminated.equals(activityState))
|
||||
if (activityState.isTerminated())
|
||||
closedState = activityWFState;
|
||||
// Overwrite if activity aborted and no other terminated
|
||||
else if (WFSTATE_Aborted.equals(activityState) && !WFSTATE_Terminated.equals(closedState))
|
||||
else if (activityState.isAborted() && !WFSTATE_Terminated.equals(closedState))
|
||||
closedState = activityWFState;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -420,7 +420,7 @@ public class ExportHelper {
|
|||
whereClause.append(" AND ").append(embeddedFormat.getWhereClause());
|
||||
}
|
||||
String columnName = "";
|
||||
if(formatLine.getAD_Reference_ID()== DisplayType.Table | formatLine.getAD_Reference_ID()==DisplayType.Search)
|
||||
if(formatLine.getAD_Reference_ID()== DisplayType.Table || formatLine.getAD_Reference_ID()==DisplayType.Search)
|
||||
{
|
||||
MColumn column = MColumn.get(masterPO.getCtx(), formatLine.getAD_Column_ID());
|
||||
columnName = column.getColumnName();
|
||||
|
|
|
@ -1206,7 +1206,7 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener
|
|||
{
|
||||
CTabbedPane tab = (CTabbedPane) e.getSource();
|
||||
|
||||
if(tab.getSelectedIndex() == 4 & warehouseTbl.getRowCount() > 0)
|
||||
if(tab.getSelectedIndex() == 4 && warehouseTbl.getRowCount() > 0)
|
||||
{
|
||||
// If no warehouse row is selected in the warehouse tab, use the first warehouse
|
||||
// row to prevent array index out of bounds. BF 3051361
|
||||
|
|
|
@ -281,7 +281,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev
|
|||
|
||||
Integer C_BPartner_ID = null;
|
||||
|
||||
if (fBPartner_ID.getDisplay() != "")
|
||||
if (!"".equals(fBPartner_ID.getDisplay()))
|
||||
C_BPartner_ID = (Integer)fBPartner_ID.getValue();
|
||||
|
||||
if (C_BPartner_ID != null)
|
||||
|
@ -291,7 +291,7 @@ public class InfoAssetPanel extends InfoPanel implements ValueChangeListener, Ev
|
|||
|
||||
Integer M_Product_ID = null;
|
||||
|
||||
if (fProduct_ID.getDisplay() != "")
|
||||
if (!"".equals(fProduct_ID.getDisplay()))
|
||||
M_Product_ID = (Integer)fProduct_ID.getValue();
|
||||
|
||||
if (M_Product_ID != null)
|
||||
|
|
|
@ -318,10 +318,10 @@ public class InfoCashLinePanel extends InfoPanel implements ValueChangeListener,
|
|||
if (fName.getText().length() > 0)
|
||||
sql.append(" AND UPPER(c.Name) LIKE ?");
|
||||
|
||||
if (fCashBook_ID.getDisplay() != "")
|
||||
if (!"".equals(fCashBook_ID.getDisplay()))
|
||||
sql.append(" AND c.C_CashBook_ID=?");
|
||||
|
||||
if (fInvoice_ID.getDisplay() != "")
|
||||
if (!"".equals(fInvoice_ID.getDisplay()))
|
||||
sql.append(" AND cl.C_Invoice_ID=?");
|
||||
|
||||
if (fDateFrom.getValue() != null || fDateTo.getValue() != null)
|
||||
|
|
|
@ -299,7 +299,7 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev
|
|||
if (fPOReference.getText().length() > 0)
|
||||
sql.append(" AND UPPER(i.POReference) LIKE ?");
|
||||
|
||||
if (fBPartner_ID.getDisplay() != "")
|
||||
if (!"".equals(fBPartner_ID.getDisplay()))
|
||||
sql.append(" AND i.C_BPartner_ID=?");
|
||||
|
||||
if (fDateFrom.getValue() != null || fDateTo.getValue() != null)
|
||||
|
@ -343,7 +343,7 @@ public class InfoInOutPanel extends InfoPanel implements ValueChangeListener, Ev
|
|||
if (fPOReference.getText().length() > 0)
|
||||
pstmt.setString(index++, getSQLText(fPOReference));
|
||||
|
||||
if (fBPartner_ID.getDisplay() != "")
|
||||
if (!"".equals(fBPartner_ID.getDisplay()))
|
||||
{
|
||||
Integer bp = (Integer)fBPartner_ID.getValue();
|
||||
pstmt.setInt(index++, bp.intValue());
|
||||
|
|
|
@ -306,7 +306,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener,
|
|||
if (fDocumentNo.getText().length() > 0)
|
||||
sql.append(" AND UPPER(p.DocumentNo) LIKE ?");
|
||||
|
||||
if (fBPartner_ID.getDisplay() != "")
|
||||
if (!"".equals(fBPartner_ID.getDisplay()))
|
||||
sql.append(" AND p.C_BPartner_ID=?");
|
||||
|
||||
if (fDateFrom.getValue() != null || fDateTo.getValue() != null)
|
||||
|
@ -331,7 +331,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener,
|
|||
sql.append(" AND TRUNC(p.DateTrx) BETWEEN ? AND ?");
|
||||
}
|
||||
|
||||
if (fAmtFrom.getText() != "" || fAmtTo.getText() != "")
|
||||
if (!"".equals(fAmtFrom.getText()) || !"".equals(fAmtTo.getText()))
|
||||
{
|
||||
BigDecimal from = new BigDecimal(fAmtFrom.getValue());
|
||||
BigDecimal to = new BigDecimal(fAmtTo.getValue());
|
||||
|
@ -365,7 +365,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener,
|
|||
if (fDocumentNo.getText().length() > 0)
|
||||
pstmt.setString(index++, getSQLText(fDocumentNo));
|
||||
|
||||
if (fBPartner_ID.getDisplay() != "")
|
||||
if (!"".equals(fBPartner_ID.getDisplay()))
|
||||
{
|
||||
Integer bp = (Integer)fBPartner_ID.getValue();
|
||||
pstmt.setInt(index++, bp.intValue());
|
||||
|
@ -399,7 +399,7 @@ public class InfoPaymentPanel extends InfoPanel implements ValueChangeListener,
|
|||
}
|
||||
}
|
||||
|
||||
if (fAmtFrom.getText() != "" || fAmtTo.getText() != "")
|
||||
if (!"".equals(fAmtFrom.getText()) || !"".equals(fAmtTo.getText()))
|
||||
{
|
||||
BigDecimal from = new BigDecimal(fAmtFrom.getValue());
|
||||
BigDecimal to = new BigDecimal(fAmtTo.getValue());
|
||||
|
|
|
@ -1385,7 +1385,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
|
|||
m_query.addRangeRestriction(ColumnSQL, parsedValue, parsedValue2,
|
||||
infoName, infoDisplay, infoDisplay_to, and, openBrackets);
|
||||
}
|
||||
else if (isProductCategoryField && MQuery.OPERATORS[MQuery.EQUAL_INDEX].equals(op)) {
|
||||
else if (isProductCategoryField && MQuery.OPERATORS[MQuery.EQUAL_INDEX].getValue().equals(Operator)) {
|
||||
if (!(parsedValue instanceof Integer)) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue