IDEMPIERE-4652 Remove Eclipse warnings (#533)

This commit is contained in:
hengsin 2021-01-19 00:32:25 +08:00 committed by GitHub
parent 0cfa1c182a
commit 1afe4fe0c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 71 additions and 183 deletions

View File

@ -349,15 +349,12 @@ public class CommissionCalc extends SvrProcess
*/ */
private void createDetail (String sql, MCommissionAmt comAmt) throws Exception private void createDetail (String sql, MCommissionAmt comAmt) throws Exception
{ {
PreparedStatement pstmt = null; try (PreparedStatement pstmt = DB.prepareStatement(sql, get_TrxName());)
ResultSet rs = null;
try
{ {
pstmt = DB.prepareStatement(sql, get_TrxName());
pstmt.setInt(1, m_com.getAD_Client_ID()); pstmt.setInt(1, m_com.getAD_Client_ID());
pstmt.setTimestamp(2, p_StartDate); pstmt.setTimestamp(2, p_StartDate);
pstmt.setTimestamp(3, m_EndDate); pstmt.setTimestamp(3, m_EndDate);
rs = pstmt.executeQuery(); ResultSet rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
// CommissionAmount, C_Currency_ID, Amt, Qty, // CommissionAmount, C_Currency_ID, Amt, Qty,
@ -388,11 +385,6 @@ public class CommissionCalc extends SvrProcess
{ {
throw new AdempiereSystemError("System Error: " + e.getLocalizedMessage(), e); throw new AdempiereSystemError("System Error: " + e.getLocalizedMessage(), e);
} }
finally
{
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
} // createDetail } // createDetail
} // CommissionCalc } // CommissionCalc

View File

@ -95,12 +95,9 @@ public class ExpenseAPInvoice extends SvrProcess
// //
int old_BPartner_ID = -1; int old_BPartner_ID = -1;
MInvoice invoice = null; MInvoice invoice = null;
// //
PreparedStatement pstmt = null; try (PreparedStatement pstmt = DB.prepareStatement (sql.toString (), get_TrxName());)
ResultSet rs = null; {
try
{
pstmt = DB.prepareStatement (sql.toString (), get_TrxName());
int par = 1; int par = 1;
pstmt.setInt(par++, getAD_Client_ID()); pstmt.setInt(par++, getAD_Client_ID());
if (m_C_BPartner_ID != 0) if (m_C_BPartner_ID != 0)
@ -109,7 +106,7 @@ public class ExpenseAPInvoice extends SvrProcess
pstmt.setTimestamp (par++, m_DateFrom); pstmt.setTimestamp (par++, m_DateFrom);
if (m_DateTo != null) if (m_DateTo != null)
pstmt.setTimestamp (par++, m_DateTo); pstmt.setTimestamp (par++, m_DateTo);
rs = pstmt.executeQuery (); ResultSet rs = pstmt.executeQuery ();
while (rs.next()) // ********* Expense Line Loop while (rs.next()) // ********* Expense Line Loop
{ {
MTimeExpense te = new MTimeExpense (getCtx(), rs, get_TrxName()); MTimeExpense te = new MTimeExpense (getCtx(), rs, get_TrxName());
@ -201,11 +198,6 @@ public class ExpenseAPInvoice extends SvrProcess
{ {
log.log(Level.SEVERE, sql.toString(), e); log.log(Level.SEVERE, sql.toString(), e);
} }
finally
{
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
completeInvoice (invoice); completeInvoice (invoice);
StringBuilder msgreturn = new StringBuilder("@Created@=").append(m_noInvoices); StringBuilder msgreturn = new StringBuilder("@Created@=").append(m_noInvoices);
return msgreturn.toString(); return msgreturn.toString();

View File

@ -351,12 +351,9 @@ public class ImportInventory extends SvrProcess implements ImportProcess
sql = new StringBuilder ("SELECT * FROM I_Inventory ") sql = new StringBuilder ("SELECT * FROM I_Inventory ")
.append("WHERE I_IsImported='N'").append (clientCheck) .append("WHERE I_IsImported='N'").append (clientCheck)
.append(" ORDER BY M_Warehouse_ID, TRUNC(MovementDate), I_Inventory_ID"); .append(" ORDER BY M_Warehouse_ID, TRUNC(MovementDate), I_Inventory_ID");
PreparedStatement pstmt = null; try (PreparedStatement pstmt = DB.prepareStatement (sql.toString (), get_TrxName());)
ResultSet rs = null;
try
{ {
pstmt = DB.prepareStatement (sql.toString (), get_TrxName()); ResultSet rs = pstmt.executeQuery ();
rs = pstmt.executeQuery ();
// //
int x_M_Warehouse_ID = -1; int x_M_Warehouse_ID = -1;
int x_C_DocType_ID = -1; int x_C_DocType_ID = -1;
@ -487,11 +484,6 @@ public class ImportInventory extends SvrProcess implements ImportProcess
{ {
throw new AdempiereException(e); throw new AdempiereException(e);
} }
finally
{
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
// Set Error to indicator to not imported // Set Error to indicator to not imported
sql = new StringBuilder ("UPDATE I_Inventory ") sql = new StringBuilder ("UPDATE I_Inventory ")

View File

@ -412,13 +412,11 @@ public class ImportPayment extends SvrProcess
.append(" ORDER BY C_BankAccount_ID, CheckNo, DateTrx, R_AuthCode"); .append(" ORDER BY C_BankAccount_ID, CheckNo, DateTrx, R_AuthCode");
MBankAccount account = null; MBankAccount account = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
int noInsert = 0; int noInsert = 0;
try try (PreparedStatement pstmt = DB.prepareStatement(sql.toString(), get_TrxName());)
{ {
pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); ResultSet rs = pstmt.executeQuery();
rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
@ -520,12 +518,6 @@ public class ImportPayment extends SvrProcess
{ {
log.log(Level.SEVERE, sql.toString(), e); log.log(Level.SEVERE, sql.toString(), e);
} }
finally
{
DB.close(rs, pstmt);
rs = null;
pstmt = null;
}
// Set Error to indicator to not imported // Set Error to indicator to not imported
sql = new StringBuilder ("UPDATE I_Payment ") sql = new StringBuilder ("UPDATE I_Payment ")

View File

@ -223,12 +223,9 @@ public class PaySelectionCreateFrom extends SvrProcess
sql.append(sqlWhere.toString()); sql.append(sqlWhere.toString());
// //
int lines = 0; int lines = 0;
int C_CurrencyTo_ID = psel.getC_Currency_ID(); int C_CurrencyTo_ID = psel.getC_Currency_ID();
PreparedStatement pstmt = null; try (PreparedStatement pstmt = DB.prepareStatement (sql.toString(), get_TrxName());)
ResultSet rs = null; {
try
{
pstmt = DB.prepareStatement (sql.toString(), get_TrxName());
int index = 1; int index = 1;
pstmt.setInt (index++, C_CurrencyTo_ID); pstmt.setInt (index++, C_CurrencyTo_ID);
pstmt.setTimestamp(index++, psel.getPayDate()); pstmt.setTimestamp(index++, psel.getPayDate());
@ -267,7 +264,7 @@ public class PaySelectionCreateFrom extends SvrProcess
pstmt.setInt (index++, p_C_BP_Group_ID); pstmt.setInt (index++, p_C_BP_Group_ID);
} }
// //
rs = pstmt.executeQuery (); ResultSet rs = pstmt.executeQuery ();
while (rs.next ()) while (rs.next ())
{ {
int C_Invoice_ID = rs.getInt(1); int C_Invoice_ID = rs.getInt(1);
@ -301,12 +298,6 @@ public class PaySelectionCreateFrom extends SvrProcess
{ {
throw new AdempiereException(e); throw new AdempiereException(e);
} }
finally
{
DB.close(rs, pstmt);
rs = null;
pstmt = null;
}
StringBuilder msgreturn = new StringBuilder("@C_PaySelectionLine_ID@ - #").append(lines); StringBuilder msgreturn = new StringBuilder("@C_PaySelectionLine_ID@ - #").append(lines);
return msgreturn.toString(); return msgreturn.toString();
} // doIt } // doIt

View File

@ -100,13 +100,10 @@ public class SequenceCheck extends SvrProcess
+ "FROM AD_Table t " + "FROM AD_Table t "
+ "WHERE IsActive='Y' AND IsView='N'" + "WHERE IsActive='Y' AND IsView='N'"
+ " AND NOT EXISTS (SELECT * FROM AD_Sequence s " + " AND NOT EXISTS (SELECT * FROM AD_Sequence s "
+ "WHERE UPPER(s.Name)=UPPER(t.TableName) AND s.IsTableID='Y')"; + "WHERE UPPER(s.Name)=UPPER(t.TableName) AND s.IsTableID='Y')";
PreparedStatement pstmt = null; try (PreparedStatement pstmt = DB.prepareStatement(sql, trxName);)
ResultSet rs = null; {
try ResultSet rs = pstmt.executeQuery();
{
pstmt = DB.prepareStatement(sql, trxName);
rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
String tableName = rs.getString(1); String tableName = rs.getString(1);
@ -128,11 +125,6 @@ public class SequenceCheck extends SvrProcess
s_log.log(Level.SEVERE, sql, e); s_log.log(Level.SEVERE, sql, e);
throw new AdempiereException(e); throw new AdempiereException(e);
} }
finally
{
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
// Sync Table Name case // Sync Table Name case
sql = "UPDATE AD_Sequence s " sql = "UPDATE AD_Sequence s "
@ -161,10 +153,9 @@ public class SequenceCheck extends SvrProcess
+ "WHERE t.IsActive='Y' AND t.IsView='N'" + "WHERE t.IsActive='Y' AND t.IsView='N'"
+ " AND UPPER(s.Name)=UPPER(t.TableName) AND s.Name<>t.TableName"; + " AND UPPER(s.Name)=UPPER(t.TableName) AND s.Name<>t.TableName";
// //
try try (PreparedStatement pstmt = DB.prepareStatement (sql, null);)
{ {
pstmt = DB.prepareStatement (sql, null); ResultSet rs = pstmt.executeQuery ();
rs = pstmt.executeQuery ();
while (rs.next ()) while (rs.next ())
{ {
String TableName = rs.getString(1); String TableName = rs.getString(1);
@ -178,11 +169,6 @@ public class SequenceCheck extends SvrProcess
s_log.log (Level.SEVERE, sql, e); s_log.log (Level.SEVERE, sql, e);
throw new AdempiereException(e); throw new AdempiereException(e);
} }
finally
{
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
} // checkTableSequences } // checkTableSequences

View File

@ -39,7 +39,6 @@ public final class OFXFileBankStatementLoader extends OFXBankStatementHandler im
*/ */
//m_stream is not closed because the BufferedReader in the parent class is closed and according to the Java docs: //m_stream is not closed because the BufferedReader in the parent class is closed and according to the Java docs:
//Calling close() on the BufferedReader closes the underlying stream by default implementation //Calling close() on the BufferedReader closes the underlying stream by default implementation
@SuppressWarnings("resource")
public boolean init(MBankStatementLoader controller) public boolean init(MBankStatementLoader controller)
{ {
boolean result = false; boolean result = false;

View File

@ -1618,14 +1618,11 @@ public class GridTable extends AbstractTableModel
if (m_inserting) if (m_inserting)
select.append(" WHERE 1=2"); select.append(" WHERE 1=2");
else // FOR UPDATE causes - ORA-01002 fetch out of sequence else // FOR UPDATE causes - ORA-01002 fetch out of sequence
select.append(" WHERE ").append(getWhereClause(rowData)); select.append(" WHERE ").append(getWhereClause(rowData));
PreparedStatement pstmt = null; try (PreparedStatement pstmt = DB.prepareStatement (select.toString(),
ResultSet rs = null; ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE, null);)
try {
{ ResultSet rs = pstmt.executeQuery();
pstmt = DB.prepareStatement (select.toString(),
ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE, null);
rs = pstmt.executeQuery();
// only one row // only one row
if (!(m_inserting || rs.next())) if (!(m_inserting || rs.next()))
{ {
@ -2071,10 +2068,6 @@ public class GridTable extends AbstractTableModel
rs.updateRow(); rs.updateRow();
} }
log.fine("Committing ...");
DB.commit(true, null); // no Trx
DB.close(rs, pstmt);
rs = null; pstmt = null;
// //
lobSave(whereClause); lobSave(whereClause);
@ -2082,29 +2075,31 @@ public class GridTable extends AbstractTableModel
if (log.isLoggable(Level.FINE)) log.fine("Reading ... " + whereClause); if (log.isLoggable(Level.FINE)) log.fine("Reading ... " + whereClause);
StringBuilder refreshSQL = new StringBuilder(m_SQL_Select) StringBuilder refreshSQL = new StringBuilder(m_SQL_Select)
.append(" WHERE ").append(whereClause); .append(" WHERE ").append(whereClause);
pstmt = DB.prepareStatement(refreshSQL.toString(), null); try (PreparedStatement pstmt1 = DB.prepareStatement(refreshSQL.toString(), null);)
rs = pstmt.executeQuery();
if (rs.next())
{ {
rowDataDB = readData(rs); rs = pstmt1.executeQuery();
// update buffer if (rs.next())
setDataAtRow(m_rowChanged, rowDataDB);
if (m_virtual)
{ {
MSort sort = m_sort.get(m_rowChanged); rowDataDB = readData(rs);
int oldId = sort.index; // update buffer
int newId = getKeyID(m_rowChanged); setDataAtRow(m_rowChanged, rowDataDB);
if (newId != oldId) if (m_virtual)
{ {
sort.index = newId; MSort sort = m_sort.get(m_rowChanged);
Object[] data = m_virtualBuffer.remove(oldId); int oldId = sort.index;
m_virtualBuffer.put(newId, data); int newId = getKeyID(m_rowChanged);
if (newId != oldId)
{
sort.index = newId;
Object[] data = m_virtualBuffer.remove(oldId);
m_virtualBuffer.put(newId, data);
}
} }
fireTableRowsUpdated(m_rowChanged, m_rowChanged);
} }
fireTableRowsUpdated(m_rowChanged, m_rowChanged); else
log.log(Level.SEVERE, "Inserted row not found");
} }
else
log.log(Level.SEVERE, "Inserted row not found");
// //
} }
catch (Exception e) catch (Exception e)
@ -2122,12 +2117,6 @@ public class GridTable extends AbstractTableModel
fireDataStatusEEvent(msg, e.getLocalizedMessage(), true); fireDataStatusEEvent(msg, e.getLocalizedMessage(), true);
return SAVE_ERROR; return SAVE_ERROR;
} }
finally
{
DB.close(rs, pstmt);
rs = null;
pstmt = null;
}
CacheMgt.get().reset(m_tableName); CacheMgt.get().reset(m_tableName);

View File

@ -1832,7 +1832,6 @@ public class MPayment extends X_C_Payment
protected String m_processMsg = null; protected String m_processMsg = null;
/** Just Prepared Flag */ /** Just Prepared Flag */
protected boolean m_justPrepared = false; protected boolean m_justPrepared = false;
@SuppressWarnings("unused")
protected IProcessUI m_processUI; protected IProcessUI m_processUI;
/** /**

View File

@ -32,7 +32,6 @@ public class MProduction extends X_M_Production implements DocAction {
* *
*/ */
/** Log */ /** Log */
@SuppressWarnings("unused")
protected static CLogger m_log = CLogger.getCLogger (MProduction.class); protected static CLogger m_log = CLogger.getCLogger (MProduction.class);
protected int lineno; protected int lineno;
protected int count; protected int count;
@ -260,14 +259,10 @@ public class MProduction extends X_M_Production implements DocAction {
// products used in production // products used in production
String sql = "SELECT M_ProductBom_ID, BOMQty" + " FROM M_Product_BOM" String sql = "SELECT M_ProductBom_ID, BOMQty" + " FROM M_Product_BOM"
+ " WHERE M_Product_ID=" + finishedProduct.getM_Product_ID() + " ORDER BY Line"; + " WHERE M_Product_ID=" + finishedProduct.getM_Product_ID() + " ORDER BY Line";
try (PreparedStatement pstmt = DB.prepareStatement(sql, get_TrxName());) {
PreparedStatement pstmt = null; ResultSet rs = pstmt.executeQuery();
ResultSet rs = null;
try {
pstmt = DB.prepareStatement(sql, get_TrxName());
rs = pstmt.executeQuery();
while (rs.next()) { while (rs.next()) {
lineno = lineno + 10; lineno = lineno + 10;
@ -432,9 +427,6 @@ public class MProduction extends X_M_Production implements DocAction {
} catch (Exception e) { } catch (Exception e) {
throw new AdempiereException("Failed to create production lines", e); throw new AdempiereException("Failed to create production lines", e);
} }
finally {
DB.close(rs, pstmt);
}
return count; return count;
} }

View File

@ -126,14 +126,10 @@ public class MProductionPlan extends X_M_ProductionPlan {
// products used in production // products used in production
String sql = "SELECT M_ProductBom_ID, BOMQty" + " FROM M_Product_BOM" String sql = "SELECT M_ProductBom_ID, BOMQty" + " FROM M_Product_BOM"
+ " WHERE M_Product_ID=" + finishedProduct.getM_Product_ID() + " ORDER BY Line"; + " WHERE M_Product_ID=" + finishedProduct.getM_Product_ID() + " ORDER BY Line";
try (PreparedStatement pstmt = DB.prepareStatement(sql, get_TrxName());) {
PreparedStatement pstmt = null; ResultSet rs = pstmt.executeQuery();
ResultSet rs = null;
try {
pstmt = DB.prepareStatement(sql, get_TrxName());
rs = pstmt.executeQuery();
while (rs.next()) { while (rs.next()) {
lineno = lineno + 10; lineno = lineno + 10;
@ -298,9 +294,6 @@ public class MProductionPlan extends X_M_ProductionPlan {
} catch (Exception e) { } catch (Exception e) {
throw new AdempiereException("Failed to create production lines", e); throw new AdempiereException("Failed to create production lines", e);
} }
finally {
DB.close(rs, pstmt);
}
return count; return count;
} }

View File

@ -136,16 +136,13 @@ public class CashFlow extends SvrProcess {
"cp.C_CashPlan_ID " + "cp.C_CashPlan_ID " +
"FROM C_CashPlanLine cpl " + "FROM C_CashPlanLine cpl " +
"JOIN C_CashPlan cp ON (cp.C_CashPlan_ID=cpl.C_CashPlan_ID) " + "JOIN C_CashPlan cp ON (cp.C_CashPlan_ID=cpl.C_CashPlan_ID) " +
"WHERE cp.AD_Client_ID=? AND cp.IsActive='Y' AND cpl.IsActive='Y' AND cpl.DateTrx BETWEEN ? AND ?"; "WHERE cp.AD_Client_ID=? AND cp.IsActive='Y' AND cpl.IsActive='Y' AND cpl.DateTrx BETWEEN ? AND ?";
PreparedStatement pstmtPlan = null; try (PreparedStatement pstmtPlan = DB.prepareStatement(sqlPlan, get_TrxName());)
ResultSet rsPlan = null; {
try
{
pstmtPlan = DB.prepareStatement(sqlPlan, get_TrxName());
pstmtPlan.setInt(1, getAD_Client_ID()); pstmtPlan.setInt(1, getAD_Client_ID());
pstmtPlan.setTimestamp(2, p_dateFrom); pstmtPlan.setTimestamp(2, p_dateFrom);
pstmtPlan.setTimestamp(3, p_dateTo); pstmtPlan.setTimestamp(3, p_dateTo);
rsPlan = pstmtPlan.executeQuery(); ResultSet rsPlan = pstmtPlan.executeQuery();
int noPlan = 0; int noPlan = 0;
while (rsPlan.next()) while (rsPlan.next())
{ {
@ -185,25 +182,17 @@ public class CashFlow extends SvrProcess {
{ {
log.log(Level.SEVERE, sqlPlan, e); log.log(Level.SEVERE, sqlPlan, e);
} }
finally
{
DB.close(rsPlan, pstmtPlan);
rsPlan = null; pstmtPlan = null;
}
/* commitment records */ /* commitment records */
String sqlOpenOrders = "SELECT o.C_Order_ID, o.IsPayScheduleValid, " + String sqlOpenOrders = "SELECT o.C_Order_ID, o.IsPayScheduleValid, " +
"SUM((ol.QtyOrdered-ol.QtyInvoiced)*ol.PriceActual)/o.TotalLines as Pending " + "SUM((ol.QtyOrdered-ol.QtyInvoiced)*ol.PriceActual)/o.TotalLines as Pending " +
"FROM C_Order o JOIN C_OrderLine ol ON (o.C_Order_ID=ol.C_Order_ID) " + "FROM C_Order o JOIN C_OrderLine ol ON (o.C_Order_ID=ol.C_Order_ID) " +
"WHERE o.AD_Client_ID=? AND o.TotalLines != 0 AND o.DocStatus IN ('CO') AND ol.QtyInvoiced<ol.QtyOrdered " + "WHERE o.AD_Client_ID=? AND o.TotalLines != 0 AND o.DocStatus IN ('CO') AND ol.QtyInvoiced<ol.QtyOrdered " +
"GROUP BY o.C_Order_ID, o.IsPayScheduleValid, o.TotalLines"; "GROUP BY o.C_Order_ID, o.IsPayScheduleValid, o.TotalLines";
PreparedStatement pstmtOpenOrders = null; try (PreparedStatement pstmtOpenOrders = DB.prepareStatement(sqlOpenOrders, get_TrxName());)
ResultSet rsOpenOrders = null; {
try
{
pstmtOpenOrders = DB.prepareStatement(sqlOpenOrders, get_TrxName());
pstmtOpenOrders.setInt(1, getAD_Client_ID()); pstmtOpenOrders.setInt(1, getAD_Client_ID());
rsOpenOrders = pstmtOpenOrders.executeQuery(); ResultSet rsOpenOrders = pstmtOpenOrders.executeQuery();
int noOrders = 0; int noOrders = 0;
int noOrdIns = 0; int noOrdIns = 0;
int noOrdSchIns = 0; int noOrdSchIns = 0;
@ -310,25 +299,17 @@ public class CashFlow extends SvrProcess {
{ {
log.log(Level.SEVERE, sqlOpenOrders, e); log.log(Level.SEVERE, sqlOpenOrders, e);
} }
finally
{
DB.close(rsOpenOrders, pstmtOpenOrders);
rsOpenOrders = null; pstmtOpenOrders = null;
}
/* actual records */ /* actual records */
String sqlActual = "SELECT oi.AD_Org_ID, oi.C_Invoice_ID, oi.C_BPartner_ID, oi.IsSOTrx, oi.DueDate, oi.OpenAmt, oi.C_Campaign_ID, oi.C_Project_ID, oi.C_Activity_ID " + String sqlActual = "SELECT oi.AD_Org_ID, oi.C_Invoice_ID, oi.C_BPartner_ID, oi.IsSOTrx, oi.DueDate, oi.OpenAmt, oi.C_Campaign_ID, oi.C_Project_ID, oi.C_Activity_ID " +
"FROM RV_OpenItem oi " + "FROM RV_OpenItem oi " +
"WHERE oi.AD_Client_ID=? AND oi.DueDate <= ?"; "WHERE oi.AD_Client_ID=? AND oi.DueDate <= ?";
PreparedStatement pstmtActual = null; try (PreparedStatement pstmtActual = DB.prepareStatement(sqlActual, get_TrxName());)
ResultSet rsActual = null; {
try
{
pstmtActual = DB.prepareStatement(sqlActual, get_TrxName());
pstmtActual.setInt(1, getAD_Client_ID()); pstmtActual.setInt(1, getAD_Client_ID());
pstmtActual.setTimestamp(2, p_dateTo); pstmtActual.setTimestamp(2, p_dateTo);
rsActual = pstmtActual.executeQuery(); ResultSet rsActual = pstmtActual.executeQuery();
int noInv = 0; int noInv = 0;
while (rsActual.next()) while (rsActual.next())
{ {
@ -367,11 +348,6 @@ public class CashFlow extends SvrProcess {
{ {
log.log(Level.SEVERE, sqlActual, e); log.log(Level.SEVERE, sqlActual, e);
} }
finally
{
DB.close(rsActual, pstmtActual);
rsActual = null; pstmtActual = null;
}
/* subtract from plan lines the related orders */ /* subtract from plan lines the related orders */
String sqlupdord = "UPDATE T_CashFlow " + String sqlupdord = "UPDATE T_CashFlow " +

View File

@ -53,7 +53,7 @@ public class ServletContextAdaptor implements ServletContext {
return null; return null;
try { try {
Method getResourcePathsMethod = httpContext.getClass().getMethod("getResourcePaths", new Class[] {String.class}); //$NON-NLS-1$ Method getResourcePathsMethod = httpContext.getClass().getMethod("getResourcePaths", new Class[] {String.class}); //$NON-NLS-1$
if (!getResourcePathsMethod.isAccessible()) if (!getResourcePathsMethod.canAccess(httpContext))
getResourcePathsMethod.setAccessible(true); getResourcePathsMethod.setAccessible(true);
return (Set<String>) getResourcePathsMethod.invoke(httpContext, new Object[] {name}); return (Set<String>) getResourcePathsMethod.invoke(httpContext, new Object[] {name});
} catch (Exception e) { } catch (Exception e) {

View File

@ -133,13 +133,10 @@ public class GenericPOElementHandler extends AbstractElementHandler {
int tableId = Env.getContextAsInt(ctx.ctx, DataElementParameters.AD_TABLE_ID); int tableId = Env.getContextAsInt(ctx.ctx, DataElementParameters.AD_TABLE_ID);
String tableName = MTable.getTableName(ctx.ctx, tableId); String tableName = MTable.getTableName(ctx.ctx, tableId);
List<String> excludes = defaultExcludeList(tableName); List<String> excludes = defaultExcludeList(tableName);
boolean checkExcluded = ! sql.toLowerCase().startsWith("select *"); boolean checkExcluded = ! sql.toLowerCase().startsWith("select *");
Statement stmt = null; try (Statement stmt = DB.createStatement();) {
ResultSet rs = null; sql = MRole.getDefault().addAccessSQL(sql, tableName, true, true);
try { ResultSet rs = stmt.executeQuery(sql);
sql = MRole.getDefault().addAccessSQL(sql, tableName, true, true);
stmt = DB.createStatement();
rs = stmt.executeQuery(sql);
while (rs.next()) { while (rs.next()) {
GenericPO po = new GenericPO(tableName, ctx.ctx, rs, getTrxName(ctx)); GenericPO po = new GenericPO(tableName, ctx.ctx, rs, getTrxName(ctx));
int AD_Client_ID = po.getAD_Client_ID(); int AD_Client_ID = po.getAD_Client_ID();
@ -212,8 +209,6 @@ public class GenericPOElementHandler extends AbstractElementHandler {
} }
} catch (Exception e) { } catch (Exception e) {
throw new AdempiereException(e); throw new AdempiereException(e);
} finally {
DB.close(rs, stmt);
} }
} }

View File

@ -21,6 +21,7 @@ import java.lang.ref.WeakReference;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Locale; import java.util.Locale;
import java.util.Properties; import java.util.Properties;
import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
@ -459,7 +460,7 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
clientInfo.desktopXOffset = c.getDesktopXOffset(); clientInfo.desktopXOffset = c.getDesktopXOffset();
clientInfo.desktopYOffset = c.getDesktopYOffset(); clientInfo.desktopYOffset = c.getDesktopYOffset();
clientInfo.orientation = c.getOrientation(); clientInfo.orientation = c.getOrientation();
clientInfo.timeZone = c.getTimeZone(); clientInfo.timeZone = TimeZone.getTimeZone(c.getZoneId());
String ua = Servlets.getUserAgent((ServletRequest) Executions.getCurrent().getNativeRequest()); String ua = Servlets.getUserAgent((ServletRequest) Executions.getCurrent().getNativeRequest());
clientInfo.userAgent = ua; clientInfo.userAgent = ua;
ua = ua.toLowerCase(); ua = ua.toLowerCase();

View File

@ -358,7 +358,6 @@ public class FDialog
} }
public static void askForInput(final String message, MLookup lookup, int editorType, final Callback<Object> callback, Desktop desktop, int windowNo) { public static void askForInput(final String message, MLookup lookup, int editorType, final Callback<Object> callback, Desktop desktop, int windowNo) {
@SuppressWarnings("unused")
final WEditor weditor; final WEditor weditor;
switch (editorType) { switch (editorType) {