details:   https://code.openbravo.com/erp/devel/pi/rev/bc75e2f8abaf
changeset: 16758:bc75e2f8abaf
user:      Egoitz Castillo <egoitz.castillo <at> openbravo.com>
date:      Wed Jun 06 08:33:25 2012 +0200
summary:   Related to issue 20551. Performance on Match Statement window

diffstat:

 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java
 |  14 +++++----
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r 0be01c180707 -r bc75e2f8abaf 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java
        Tue Jun 05 19:40:03 2012 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/MatchTransactionDao.java
        Wed Jun 06 08:33:25 2012 +0200
@@ -407,14 +407,15 @@
       
projections.add(Projections.sum(FIN_BankStatementLine.PROPERTY_DRAMOUNT));
       obcBsl.setProjection(projections);
 
-      if (obcBsl.list() != null && obcBsl.list().size() > 0) {
-        @SuppressWarnings("rawtypes")
-        List o = obcBsl.list();
+      @SuppressWarnings("rawtypes")
+      List o = obcBsl.list();
+      if (o != null && o.size() > 0) {
         Object[] resultSet = (Object[]) o.get(0);
         BigDecimal credit = (resultSet[0] != null) ? (BigDecimal) resultSet[0] 
: BigDecimal.ZERO;
         BigDecimal debit = (resultSet[1] != null) ? (BigDecimal) resultSet[1] 
: BigDecimal.ZERO;
         total = credit.subtract(debit);
       }
+      o.clear();
 
     } finally {
       OBContext.restorePreviousMode();
@@ -459,14 +460,15 @@
       
projections.add(Projections.sum(FIN_BankStatementLine.PROPERTY_DRAMOUNT));
       obcBsl.setProjection(projections);
 
-      if (obcBsl.list() != null && obcBsl.list().size() > 0) {
-        @SuppressWarnings("rawtypes")
-        List o = obcBsl.list();
+      @SuppressWarnings("rawtypes")
+      List o = obcBsl.list();
+      if (o != null && o.size() > 0) {
         Object[] resultSet = (Object[]) o.get(0);
         BigDecimal credit = (resultSet[0] != null) ? (BigDecimal) resultSet[0] 
: BigDecimal.ZERO;
         BigDecimal debit = (resultSet[1] != null) ? (BigDecimal) resultSet[1] 
: BigDecimal.ZERO;
         total = credit.subtract(debit);
       }
+      o.clear();
 
     } finally {
       OBContext.restorePreviousMode();

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to