From e03872d7d41c387f9b9d98c488e0aff2f09b4970 Mon Sep 17 00:00:00 2001 From: trifonnt Date: Wed, 8 Jul 2009 13:56:20 +0000 Subject: [PATCH] Small Typo fixes. Use finally and DB.close() instead of rs.close() and pstmt.close() --- base/src/org/compiere/process/InvoicePrint.java | 17 +++++++++++------ base/src/org/compiere/process/ProjectIssue.java | 3 ++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/base/src/org/compiere/process/InvoicePrint.java b/base/src/org/compiere/process/InvoicePrint.java index 15f26d5d43..25538ec969 100644 --- a/base/src/org/compiere/process/InvoicePrint.java +++ b/base/src/org/compiere/process/InvoicePrint.java @@ -40,7 +40,7 @@ import org.compiere.util.Ini; import org.compiere.util.Language; /** - * Print Invoices on Paperor send PDFs + * Print Invoices on Paper or send PDFs * * @author Jorg Janke * @version $Id: InvoicePrint.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ @@ -218,12 +218,16 @@ public class InvoicePrint extends SvrProcess int C_BPartner_ID = 0; int count = 0; int errors = 0; + PreparedStatement pstmt = null; + ResultSet rs = null; + try { - PreparedStatement pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); + pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); pstmt.setInt(1, Env.getAD_Client_ID(Env.getCtx())); pstmt.setInt(2, Env.getAD_Org_ID(Env.getCtx())); - ResultSet rs = pstmt.executeQuery(); + rs = pstmt.executeQuery(); + while (rs.next()) { int C_Invoice_ID = rs.getInt(1); @@ -344,15 +348,16 @@ public class InvoicePrint extends SvrProcess .append (C_Invoice_ID); int no = DB.executeUpdate(sb.toString(), get_TrxName()); } - } // for all entries - rs.close(); - pstmt.close(); + } // for all entries } catch (Exception e) { log.log(Level.SEVERE, "doIt - " + sql, e); throw new Exception (e); } + finally { + DB.close(rs, pstmt); + } // if (p_EMailPDF) return "@Sent@=" + count + " - @Errors@=" + errors; diff --git a/base/src/org/compiere/process/ProjectIssue.java b/base/src/org/compiere/process/ProjectIssue.java index 6b84955df6..b993289156 100644 --- a/base/src/org/compiere/process/ProjectIssue.java +++ b/base/src/org/compiere/process/ProjectIssue.java @@ -51,6 +51,7 @@ public class ProjectIssue extends SvrProcess /** Product - Option 4 */ private int m_M_Product_ID = 0; /** Attribute - Option 4 */ + @SuppressWarnings("unused") private int m_M_AttributeSetInstance_ID = 0; /** Qty - Option 4 */ private BigDecimal m_MovementQty = null; @@ -345,7 +346,7 @@ public class ProjectIssue extends SvrProcess } // projectIssueHasExpense /** - * Check if Project Isssye already has Receipt + * Check if Project Issue already has Receipt * @param M_InOutLine_ID line * @return true if exists */