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()));
|
.append(DisplayType.getDateFormat(DisplayType.Date).format(te.getDateReport()));
|
||||||
invoice.setDescription(descr.toString());
|
invoice.setDescription(descr.toString());
|
||||||
if (!invoice.save())
|
if (!invoice.save())
|
||||||
new IllegalStateException("Cannot save Invoice");
|
throw new IllegalStateException("Cannot save Invoice");
|
||||||
old_BPartner_ID = bp.getC_BPartner_ID();
|
old_BPartner_ID = bp.getC_BPartner_ID();
|
||||||
}
|
}
|
||||||
MTimeExpenseLine[] tel = te.getLines(false);
|
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())
|
if (line.getC_Project_ID() != 0 && line.getC_Project_ID() != invoice.getC_Project_ID())
|
||||||
invoice.setC_Project_ID(line.getC_Project_ID());
|
invoice.setC_Project_ID(line.getC_Project_ID());
|
||||||
if (!invoice.save())
|
if (!invoice.save())
|
||||||
new IllegalStateException("Cannot save Invoice");
|
throw new IllegalStateException("Cannot save Invoice");
|
||||||
|
|
||||||
// Create OrderLine
|
// Create OrderLine
|
||||||
MInvoiceLine il = new MInvoiceLine (invoice);
|
MInvoiceLine il = new MInvoiceLine (invoice);
|
||||||
|
@ -184,7 +184,7 @@ public class ExpenseAPInvoice extends SvrProcess
|
||||||
il.setPrice(line.getPriceReimbursed()); //
|
il.setPrice(line.getPriceReimbursed()); //
|
||||||
il.setTax();
|
il.setTax();
|
||||||
if (!il.save())
|
if (!il.save())
|
||||||
new IllegalStateException("Cannot save Invoice Line");
|
throw new IllegalStateException("Cannot save Invoice Line");
|
||||||
// Update TEL
|
// Update TEL
|
||||||
line.setC_InvoiceLine_ID(il.getC_InvoiceLine_ID());
|
line.setC_InvoiceLine_ID(il.getC_InvoiceLine_ID());
|
||||||
line.saveEx();
|
line.saveEx();
|
||||||
|
@ -221,7 +221,7 @@ public class ExpenseAPInvoice extends SvrProcess
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!invoice.save())
|
if (!invoice.save())
|
||||||
new IllegalStateException("Cannot save Invoice");
|
throw new IllegalStateException("Cannot save Invoice");
|
||||||
//
|
//
|
||||||
m_noInvoices++;
|
m_noInvoices++;
|
||||||
addLog(invoice.get_ID(), invoice.getDateInvoiced(),
|
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())
|
if (tel.getC_Campaign_ID() != 0 && tel.getC_Campaign_ID() != m_order.getC_Campaign_ID())
|
||||||
m_order.setC_Campaign_ID(tel.getC_Campaign_ID());
|
m_order.setC_Campaign_ID(tel.getC_Campaign_ID());
|
||||||
if (!m_order.save())
|
if (!m_order.save())
|
||||||
new IllegalStateException("Cannot save Order");
|
throw new IllegalStateException("Cannot save Order");
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderLine
|
// OrderLine
|
||||||
|
|
|
@ -666,7 +666,7 @@ public class DashboardController implements EventListener<Event> {
|
||||||
private ReportEngine runReport(int AD_Process_ID, String parameters) {
|
private ReportEngine runReport(int AD_Process_ID, String parameters) {
|
||||||
MProcess process = MProcess.get(Env.getCtx(), AD_Process_ID);
|
MProcess process = MProcess.get(Env.getCtx(), AD_Process_ID);
|
||||||
if (!process.isReport() || process.getAD_ReportView_ID() == 0)
|
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.getName());
|
||||||
// Process
|
// Process
|
||||||
int AD_Table_ID = 0;
|
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_Client_ID(Env.getAD_Client_ID(Env.getCtx()));
|
||||||
pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID());
|
pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID());
|
||||||
if (!process.processIt(pi, null) && pi.getClassName() != null)
|
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
|
// Report
|
||||||
ReportEngine re = ReportEngine.get(Env.getCtx(), pi);
|
ReportEngine re = ReportEngine.get(Env.getCtx(), pi);
|
||||||
if (re == null)
|
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());
|
+ " - " + process.getName());
|
||||||
|
|
||||||
return re;
|
return re;
|
||||||
|
|
Loading…
Reference in New Issue