Author: sbavencoff Date: 2014-01-06 17:50:14 +0100 (Mon, 06 Jan 2014) New Revision: 3737 Url: http://chorem.org/projects/lima/repository/revisions/3737 Log: fixes #968 : fix bug if entryTarget.getVoucher() is null Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2014-01-06 16:20:04 UTC (rev 3736) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionViewHandler.java 2014-01-06 16:50:14 UTC (rev 3737) @@ -25,6 +25,7 @@ package org.chorem.lima.ui.financialtransaction; +import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -452,7 +453,7 @@ } } - /** + /** * Add new transaction. */ public void addFinancialTransaction() { @@ -668,10 +669,7 @@ FinancialTransactionTableModel tableModel = view.getFinancialTransactionTableModel(); ListSelectionModel selectionModel = table.getSelectionModel(); - if (table.isEditing()) { - TableCellEditor editor = table.getCellEditor(); - editor.stopCellEditing(); - } + table.exit(); int selectedRow = table.getSelectedRow(); int selectedColumn = table.getSelectedColumn(); @@ -682,13 +680,13 @@ if (entrySource != entryTarget) { switch (selectedColumn) { case 1 : - if (entryTarget.getVoucher().compareTo(entrySource.getVoucher()) != 0) { + if (!StringUtils.equals(entryTarget.getVoucher(), entrySource.getVoucher())) { entryTarget.setVoucher(entrySource.getVoucher()); financialTransactionService.updateEntry(entryTarget); } break; case 3 : - if (entryTarget.getDescription().compareTo(entrySource.getDescription()) != 0) { + if (!StringUtils.equals(entryTarget.getDescription(), entrySource.getDescription())) { entryTarget.setDescription(entrySource.getDescription()); financialTransactionService.updateEntry(entryTarget); }