IDEMPIERE-455 Discover and fix FindBugs problems / Pattern: RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE

This commit is contained in:
Richard Morales 2012-12-05 17:36:30 -05:00
parent 75628911f2
commit 751f74cb46
3 changed files with 3 additions and 3 deletions

View File

@ -197,12 +197,12 @@ public class Doc_Production extends Doc
fl = fact.createLine(line, fl = fact.createLine(line,
account, account,
as.getC_Currency_ID(), variance.negate()); as.getC_Currency_ID(), variance.negate());
fl.setQty(Env.ZERO);
if (fl == null) if (fl == null)
{ {
p_Error = "Couldn't post variance " + line.getLine() + " - " + line; p_Error = "Couldn't post variance " + line.getLine() + " - " + line;
return null; return null;
} }
fl.setQty(Env.ZERO);
} }
// costs = bomCost.negate(); // costs = bomCost.negate();
} }

View File

@ -950,7 +950,7 @@ public class MWFActivity extends X_AD_WF_Activity implements Runnable
*/ */
private boolean performWork (Trx trx) throws Exception private boolean performWork (Trx trx) throws Exception
{ {
log.info (m_node + " [" + trx.getTrxName() + "]"); log.info (m_node + " [" + (trx!=null ? trx.getTrxName() : "") + "]");
m_docStatus = null; m_docStatus = null;
if (m_node.getPriority() != 0) // overwrite priority if defined if (m_node.getPriority() != 0) // overwrite priority if defined
setPriority(m_node.getPriority()); setPriority(m_node.getPriority());

View File

@ -322,9 +322,9 @@ public class WTreeMaintenance extends TreeMaintenance implements IFormController
Treeitem ti = centerTree.getSelectedItem(); Treeitem ti = centerTree.getSelectedItem();
DefaultTreeNode<?> stn = (DefaultTreeNode<?>) ti.getValue(); DefaultTreeNode<?> stn = (DefaultTreeNode<?>) ti.getValue();
MTreeNode tn = (MTreeNode)stn.getData(); MTreeNode tn = (MTreeNode)stn.getData();
log.info(tn.toString());
if (tn == null) if (tn == null)
return; return;
log.info(tn.toString());
ListModel<Object> model = centerList.getModel(); ListModel<Object> model = centerList.getModel();
int size = model.getSize(); int size = model.getSize();
int index = -1; int index = -1;