VCreateFromShipment:

* fix indentation (CTRL-I)
* proper close ResultSet in finally block
This commit is contained in:
teo_sarca 2008-12-12 07:13:43 +00:00
parent f051858880
commit 02332db6db
1 changed files with 381 additions and 390 deletions

View File

@ -736,13 +736,13 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
sqlStmt.append("AND rl.C_Charge_ID IS NOT NULL"); sqlStmt.append("AND rl.C_Charge_ID IS NOT NULL");
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null;
try try
{ {
pstmt = DB.prepareStatement(sqlStmt.toString(), null); pstmt = DB.prepareStatement(sqlStmt.toString(), null);
pstmt.setInt(1, M_RMA_ID); pstmt.setInt(1, M_RMA_ID);
pstmt.setInt(2, M_RMA_ID); pstmt.setInt(2, M_RMA_ID);
ResultSet rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
@ -761,7 +761,6 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
line.add(null); //8-invoice line.add(null); //8-invoice
data.add(line); data.add(line);
} }
rs.close();
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -769,17 +768,8 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
} }
finally finally
{ {
if (pstmt != null) DB.close(rs, pstmt);
{ rs = null; pstmt = null;
try
{
pstmt.close();
}
catch (Exception ex)
{
log.severe("Could not close prepared statement");
}
}
} }
loadTableOIS(data); loadTableOIS(data);
} }
@ -803,8 +793,8 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
* *
* @return true if saved * @return true if saved
*/ */
protected boolean save() { protected boolean save()
{
dataTable.stopEditor(true); dataTable.stopEditor(true);
log.config(""); log.config("");
TableModel model = dataTable.getModel(); TableModel model = dataTable.getModel();
@ -824,7 +814,8 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
log.config(inout + ", C_Locator_ID=" + M_Locator_ID); log.config(inout + ", C_Locator_ID=" + M_Locator_ID);
// Lines // Lines
for (int i = 0; i < rows; i++) { for (int i = 0; i < rows; i++)
{
if (((Boolean) model.getValueAt(i, 0)).booleanValue()) { if (((Boolean) model.getValueAt(i, 0)).booleanValue()) {
// variable values // variable values
BigDecimal QtyEntered = (BigDecimal) model.getValueAt(i, COL_QTY); // Qty BigDecimal QtyEntered = (BigDecimal) model.getValueAt(i, COL_QTY); // Qty