details: https://code.openbravo.com/erp/devel/pi/rev/9452a1f4fa8a changeset: 34245:9452a1f4fa8a user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Thu Jun 28 12:20:33 2018 +0200 summary: related to issue 38827: minor code improvements
diffstat: src/org/openbravo/erpCommon/utility/ErrorTextParserPOSTGRE.java | 11 ++++----- 1 files changed, 5 insertions(+), 6 deletions(-) diffs (43 lines): diff -r 554d3e09f643 -r 9452a1f4fa8a src/org/openbravo/erpCommon/utility/ErrorTextParserPOSTGRE.java --- a/src/org/openbravo/erpCommon/utility/ErrorTextParserPOSTGRE.java Tue Jun 26 10:54:44 2018 +0200 +++ b/src/org/openbravo/erpCommon/utility/ErrorTextParserPOSTGRE.java Thu Jun 28 12:20:33 2018 +0200 @@ -11,7 +11,7 @@ * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SLU - * All portions are Copyright (C) 2001-2017 Openbravo SLU + * All portions are Copyright (C) 2001-2018 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -94,7 +94,7 @@ } // strip leading and trailing " character constraintName = constraintName.substring(1, constraintName.length() - 1); - log4j.debug("found constraint: " + constraintName); + log4j.debug("found constraint: {}", constraintName); return constraintName; } @@ -132,10 +132,9 @@ * @see org.openbravo.erpCommon.utility.ErrorTextParser#parse() */ public OBError parse() throws Exception { - if (getMessage().equals("")) + if (getMessage().equals("") || getConnection() == null) { return null; - else if (getConnection() == null) - return null; + } String myMessage = getMessage(); if (log4j.isDebugEnabled()) log4j.debug("Message: " + myMessage); @@ -156,7 +155,7 @@ } String translatedMsg = Utility.parseTranslation(getConnection(), getVars(), getLanguage(), myMessage); - log4j.debug("translated message: " + translatedMsg); + log4j.debug("translated message: {}", translatedMsg); OBError translatedError = new OBError(); translatedError.setType("Error"); ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits