This is an automated email from the git hooks/post-receive script. New commit to branch feature/1207 in repository lima. See http://git.chorem.org/lima.git commit 06d873b832f79fd980c3c27cdc13030f07f6984b Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Mar 21 00:32:12 2015 +0100 refs #1207 : correction d'erreurs criticals --- .../lima/report/service/DocumentService.java | 48 +++++++++++----------- .../java/org/chorem/lima/server/LimaServer.java | 2 +- .../org/chorem/lima/enums/ImportExportEnum.java | 4 -- .../lima/ui/entrybook/EntryBookViewHandler.java | 11 +++-- .../FinancialStatementChartViewHandler.java | 15 ++++--- .../lima/ui/vatchart/VatChartViewHandler.java | 2 - 6 files changed, 40 insertions(+), 42 deletions(-) diff --git a/lima-report/src/main/java/org/chorem/lima/report/service/DocumentService.java b/lima-report/src/main/java/org/chorem/lima/report/service/DocumentService.java index 2fe3fce..b85a78b 100644 --- a/lima-report/src/main/java/org/chorem/lima/report/service/DocumentService.java +++ b/lima-report/src/main/java/org/chorem/lima/report/service/DocumentService.java @@ -22,17 +22,9 @@ package org.chorem.lima.report.service; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.math.BigDecimal; -import java.net.URL; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - +import com.google.common.base.Strings; +import com.google.common.collect.Lists; +import net.sf.jasperreports.engine.JasperReport; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -58,10 +50,16 @@ import org.chorem.lima.report.DocumentsEnum; import org.chorem.lima.report.LimaReportConfig; import org.nuiton.util.FileUtil; -import com.google.common.base.Strings; -import com.google.common.collect.Lists; - -import net.sf.jasperreports.engine.JasperReport; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.net.URL; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; import static org.nuiton.i18n.I18n.t; @@ -440,13 +438,13 @@ public class DocumentService { return subTitle; } - protected String constructTableHeader(String[] columnsNames) { - String header = "\t\t<thead>\n\t\t\t<tr>\n"; + protected String constructTableHeader(String... columnsNames) { + StringBuilder builder = new StringBuilder("\t\t<thead>\n\t\t\t<tr>\n"); for (String name : columnsNames) { - header += "\t\t\t\t<th>" + name + "</th>\n"; + builder.append("\t\t\t\t<th>").append(name).append("</th>\n"); } - header += "\t\t\t</tr>\t\t\n</thead>\n"; - return header; + builder.append("\t\t\t</tr>\t\t\n</thead>\n"); + return builder.toString(); } protected String constructTableLine(String[] cells, boolean even) { @@ -459,13 +457,13 @@ public class DocumentService { return line; } - protected String constructTableLine(String[] cells) { - String line = "\t\t<tr>\n"; + protected String constructTableLine(String... cells) { + StringBuilder builder = new StringBuilder("\t\t<tr>\n"); for (String cell : cells) { - line += "\t\t\t<td>" + cell + "</td>\n"; + builder.append("\t\t\t<td>").append(cell).append("</td>\n"); } - line += "\t\t</tr>\n"; - return line; + builder.append("\t\t</tr>\n"); + return builder.toString(); } protected String constructHeaderTitle(String title, Date beginDate, Date endDate) { diff --git a/lima-server/src/main/java/org/chorem/lima/server/LimaServer.java b/lima-server/src/main/java/org/chorem/lima/server/LimaServer.java index a2aa1b2..d1f35ad 100644 --- a/lima-server/src/main/java/org/chorem/lima/server/LimaServer.java +++ b/lima-server/src/main/java/org/chorem/lima/server/LimaServer.java @@ -76,7 +76,7 @@ public class LimaServer { LimaServerConfig.getInstance().getConfig().saveForUser(); // block main otherwize, main will end - synchronized (properties) { + synchronized (LimaServer.class) { try { properties.wait(); } catch (InterruptedException e) { diff --git a/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java b/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java index a7b4a1f..2d9aa4a 100644 --- a/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java +++ b/lima-swing/src/main/java/org/chorem/lima/enums/ImportExportEnum.java @@ -82,10 +82,6 @@ import java.net.URL; } } - if (result == null) { - throw new LimaTechnicalException(String.format("Could not load file: %s", filePAth)); - } - return result; } diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java index 3236d79..a9cf069 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/entrybook/EntryBookViewHandler.java @@ -25,6 +25,7 @@ package org.chorem.lima.ui.entrybook; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.lima.LimaSwingConfig; +import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.EntryBookService; import org.chorem.lima.business.api.ImportService; @@ -32,14 +33,17 @@ import org.chorem.lima.business.exceptions.AlreadyExistEntryBookException; import org.chorem.lima.business.exceptions.UsedEntryBookException; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.entity.EntryBookImpl; -import org.chorem.lima.enums.EntryBooksChartEnum; import org.chorem.lima.enums.ImportExportEnum; -import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.ui.importexport.ImportExport; import org.chorem.lima.util.ErrorHelper; import org.jdesktop.swingx.JXTable; -import javax.swing.*; +import javax.swing.AbstractAction; +import javax.swing.ActionMap; +import javax.swing.InputMap; +import javax.swing.JComponent; +import javax.swing.JOptionPane; +import javax.swing.KeyStroke; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; @@ -286,7 +290,6 @@ public class EntryBookViewHandler implements ServiceListener { // if action confirmed if (value != null) { - EntryBooksChartEnum defaultEntryBooksEnum = (EntryBooksChartEnum) value; ImportExport importExport = new ImportExport(view); importExport.importExport(ImportExportEnum.CSV_ENTRYBOOKS_IMPORT, null, null, true); diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java index 70f0a6c..6905252 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartViewHandler.java @@ -24,23 +24,28 @@ package org.chorem.lima.ui.financialstatementchart; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.business.ServiceListener; import org.chorem.lima.business.api.FinancialStatementService; import org.chorem.lima.business.api.ImportService; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.FinancialStatement; import org.chorem.lima.entity.FinancialStatementImpl; -import org.chorem.lima.enums.FinancialStatementsChartEnum; import org.chorem.lima.enums.ImportExportEnum; -import org.chorem.lima.business.LimaServiceFactory; import org.chorem.lima.ui.importexport.ImportExport; import org.chorem.lima.util.ReportDialogView; import org.jdesktop.swingx.JXTreeTable; import org.nuiton.util.Resource; -import javax.swing.*; +import javax.swing.AbstractAction; +import javax.swing.ActionMap; +import javax.swing.InputMap; +import javax.swing.JComponent; +import javax.swing.JOptionPane; +import javax.swing.JTextArea; +import javax.swing.KeyStroke; import javax.swing.tree.TreePath; -import java.awt.*; +import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; @@ -386,8 +391,6 @@ public class FinancialStatementChartViewHandler implements ServiceListener { if (form.getDeleteFinancialStatementChart().isSelected()) { financialStatementService.removeAllFinancialStatement(); } - FinancialStatementsChartEnum defaultFinancialStatementsEnum = - (FinancialStatementsChartEnum) value; ImportExport importExport = new ImportExport(view); importExport.importExport(ImportExportEnum.CSV_FINANCIALSTATEMENTS_IMPORT, null, null, true); diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java index 6ac3baf..9b0cfc1 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartViewHandler.java @@ -224,8 +224,6 @@ public class VatChartViewHandler implements ServiceListener { if (form.getDeleteVatStatementChart().isSelected()) { vatStatementService.removeAllVatStatement(); } - VatStatementsChartEnum defaultVatStatementsEnum = - (VatStatementsChartEnum) value; ImportExport importExport = new ImportExport(view); importExport.importExport(ImportExportEnum.CSV_VAT_IMPORT, null, null, true); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.