IDEMPIERE-455 Discover and fix FindBugs problems / Pattern RV_EXCEPTION_NOT_THROWN
This commit is contained in:
parent
a5adac4806
commit
b5a2bd6dba
|
@ -142,7 +142,7 @@ public class ExpenseAPInvoice extends SvrProcess
|
|||
.append(DisplayType.getDateFormat(DisplayType.Date).format(te.getDateReport()));
|
||||
invoice.setDescription(descr.toString());
|
||||
if (!invoice.save())
|
||||
new IllegalStateException("Cannot save Invoice");
|
||||
throw new IllegalStateException("Cannot save Invoice");
|
||||
old_BPartner_ID = bp.getC_BPartner_ID();
|
||||
}
|
||||
MTimeExpenseLine[] tel = te.getLines(false);
|
||||
|
@ -164,7 +164,7 @@ public class ExpenseAPInvoice extends SvrProcess
|
|||
if (line.getC_Project_ID() != 0 && line.getC_Project_ID() != invoice.getC_Project_ID())
|
||||
invoice.setC_Project_ID(line.getC_Project_ID());
|
||||
if (!invoice.save())
|
||||
new IllegalStateException("Cannot save Invoice");
|
||||
throw new IllegalStateException("Cannot save Invoice");
|
||||
|
||||
// Create OrderLine
|
||||
MInvoiceLine il = new MInvoiceLine (invoice);
|
||||
|
@ -184,7 +184,7 @@ public class ExpenseAPInvoice extends SvrProcess
|
|||
il.setPrice(line.getPriceReimbursed()); //
|
||||
il.setTax();
|
||||
if (!il.save())
|
||||
new IllegalStateException("Cannot save Invoice Line");
|
||||
throw new IllegalStateException("Cannot save Invoice Line");
|
||||
// Update TEL
|
||||
line.setC_InvoiceLine_ID(il.getC_InvoiceLine_ID());
|
||||
line.saveEx();
|
||||
|
@ -221,7 +221,7 @@ public class ExpenseAPInvoice extends SvrProcess
|
|||
|
||||
}
|
||||
if (!invoice.save())
|
||||
new IllegalStateException("Cannot save Invoice");
|
||||
throw new IllegalStateException("Cannot save Invoice");
|
||||
//
|
||||
m_noInvoices++;
|
||||
addLog(invoice.get_ID(), invoice.getDateInvoiced(),
|
||||
|
|
|
@ -216,7 +216,7 @@ public class ExpenseSOrder extends SvrProcess
|
|||
if (tel.getC_Campaign_ID() != 0 && tel.getC_Campaign_ID() != m_order.getC_Campaign_ID())
|
||||
m_order.setC_Campaign_ID(tel.getC_Campaign_ID());
|
||||
if (!m_order.save())
|
||||
new IllegalStateException("Cannot save Order");
|
||||
throw new IllegalStateException("Cannot save Order");
|
||||
}
|
||||
|
||||
// OrderLine
|
||||
|
|
|
@ -666,7 +666,7 @@ public class DashboardController implements EventListener<Event> {
|
|||
private ReportEngine runReport(int AD_Process_ID, String parameters) {
|
||||
MProcess process = MProcess.get(Env.getCtx(), AD_Process_ID);
|
||||
if (!process.isReport() || process.getAD_ReportView_ID() == 0)
|
||||
new IllegalArgumentException("Not a Report AD_Process_ID=" + process.getAD_Process_ID()
|
||||
throw new IllegalArgumentException("Not a Report AD_Process_ID=" + process.getAD_Process_ID()
|
||||
+ " - " + process.getName());
|
||||
// Process
|
||||
int AD_Table_ID = 0;
|
||||
|
@ -681,12 +681,12 @@ public class DashboardController implements EventListener<Event> {
|
|||
pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx()));
|
||||
pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID());
|
||||
if (!process.processIt(pi, null) && pi.getClassName() != null)
|
||||
new IllegalStateException("Process failed: (" + pi.getClassName() + ") " + pi.getSummary());
|
||||
throw new IllegalStateException("Process failed: (" + pi.getClassName() + ") " + pi.getSummary());
|
||||
|
||||
// Report
|
||||
ReportEngine re = ReportEngine.get(Env.getCtx(), pi);
|
||||
if (re == null)
|
||||
new IllegalStateException("Cannot create Report AD_Process_ID=" + process.getAD_Process_ID()
|
||||
throw new IllegalStateException("Cannot create Report AD_Process_ID=" + process.getAD_Process_ID()
|
||||
+ " - " + process.getName());
|
||||
|
||||
return re;
|
||||
|
|
Loading…
Reference in New Issue