[pi-code-cleaning] Finally blocks does not complete normally warnings fixed.
authorNaroa Iriarte <naroa.iriarte@openbravo.com>
Thu, 28 Apr 2016 11:28:26 +0200
changeset 29524 ca070e9acdd1
parent 29523 d14b1ea13eb2
child 29525 edc77c7c500a
[pi-code-cleaning] Finally blocks does not complete normally warnings fixed.

There were some warnings about finally blocks not completing normally, that was
caused because the return statement was inside them. These warnings have been fixed.
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java
src/org/openbravo/base/secureApp/VariablesSecureApp.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Thu Apr 28 10:33:34 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Thu Apr 28 11:28:26 2016 +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) 2010-2015 Openbravo SLU
+ * All portions are Copyright (C) 2010-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -502,10 +502,8 @@
       return targetBusinessPartnerId;
     } catch (Exception e) {
       log4j.error(e.getStackTrace());
-    } finally {
       return targetBusinessPartnerId;
     }
-
   }
 
   private BankFileFormat getBankFileFormat() {
--- a/src/org/openbravo/base/secureApp/VariablesSecureApp.java	Thu Apr 28 10:33:34 2016 +0200
+++ b/src/org/openbravo/base/secureApp/VariablesSecureApp.java	Thu Apr 28 11:28:26 2016 +0200
@@ -1,6 +1,6 @@
 /*
  ************************************************************************************
- * Copyright (C) 2001-2012 Openbravo S.L.U.
+ * Copyright (C) 2001-2016 Openbravo S.L.U.
  * Licensed under the Apache Software License version 2.0
  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to  in writing,  software  distributed
@@ -22,6 +22,7 @@
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.scheduling.OBScheduler;
+import org.quartz.SchedulerException;
 
 /**
  * This class is used to provide the coder with friendly methods to retrieve certain environment,
@@ -221,6 +222,7 @@
    * corresponds to the theme's folder name in the web/skins. Default theme's value is 'Default'.
    * 
    * @return String with the unique name of the theme.
+   * @throws SchedulerException
    */
   public String getTheme() {
     if (!theme.equals("")) {
@@ -248,12 +250,14 @@
             OBContext.restorePreviousMode();
           }
         }
+      } catch (SchedulerException e) {
+        log4j.error("Error while checking if the scheduler is started.", e);
       } finally {
         if (strTheme.isEmpty()) {
           strTheme = "ltr/org.openbravo.userinterface.skin.250to300Comp/250to300Comp";
         }
-        return strTheme;
       }
+      return strTheme;
     }
   }