Issue 30053. Part 3: Delete local unused variables (easy cases)
authorStefan Hühner <stefan.huehner@openbravo.com>
Sat, 30 May 2015 20:59:23 +0200
changeset 26811 cb3442689716
parent 26810 4408556e4cb4
child 26812 ada6ae238e94
Issue 30053. Part 3: Delete local unused variables (easy cases)

This removes unused local variables / fields for all the easy cases.
Where there is no user besides the variables declaration/init and
where it is clear that just deleting it is the right thing to do (so
no doubt it should be used instead of deleting it)
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PaymentSelectorFilterExpression.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java
src-core/src/org/openbravo/xmlEngine/XmlVectorValue.java
src-test/src/org/openbravo/test/dal/DalPerformanceExampleTest.java
src-wad/src/org/openbravo/wad/Wad.java
src/org/openbravo/base/model/ModelProvider.java
src/org/openbravo/common/actionhandler/RMInOutPickEditLines.java
src/org/openbravo/common/actionhandler/RMShipmentPickEditLines.java
src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java
src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java
src/org/openbravo/erpCommon/ad_actionButton/EditCCPMeasureValues.java
src/org/openbravo/erpCommon/ad_callouts/SL_Asset_Product.java
src/org/openbravo/erpCommon/ad_callouts/SL_PC_Case_Product.java
src/org/openbravo/erpCommon/ad_process/DeleteClient.java
src/org/openbravo/erpCommon/ad_process/ResetAccountingProcess.java
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR.java
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR_legacy.java
src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java
src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
src/org/openbravo/event/InvoiceLineEventHandler.java
src/org/openbravo/event/MInOutLineEventHandler.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java	Sat May 30 20:29:02 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java	Sat May 30 20:59:23 2015 +0200
@@ -30,9 +30,7 @@
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.provider.OBProvider;
-import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.client.application.process.BaseProcessActionHandler;
-import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBDao;
@@ -49,7 +47,6 @@
   protected JSONObject doExecute(Map<String, Object> parameters, String content) {
     JSONObject jsonRequest = null;
     OBContext.setAdminMode();
-    VariablesSecureApp vars = RequestContext.get().getVariablesSecureApp();
     try {
       jsonRequest = new JSONObject(content);
       log.debug(jsonRequest);
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PaymentSelectorFilterExpression.java	Sat May 30 20:29:02 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PaymentSelectorFilterExpression.java	Sat May 30 20:59:23 2015 +0200
@@ -21,24 +21,16 @@
 
 import java.util.Map;
 
-import javax.servlet.http.HttpSession;
-
 import org.openbravo.client.application.FilterExpression;
-import org.openbravo.client.application.OBBindingsConstants;
-import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
 
 public class PaymentSelectorFilterExpression implements FilterExpression {
   private Map<String, String> requestMap;
-  private HttpSession httpSession;
-  private String windowId;
 
   @Override
   public String getExpression(Map<String, String> _requestMap) {
     requestMap = _requestMap;
-    httpSession = RequestContext.get().getSession();
-    windowId = requestMap.get(OBBindingsConstants.WINDOW_ID_PARAM);
 
     if (requestMap.containsKey("inpfinFinancialAccountId")) {
       FIN_FinancialAccount financialaccount = OBDal.getInstance().get(FIN_FinancialAccount.class,
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java	Sat May 30 20:29:02 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java	Sat May 30 20:59:23 2015 +0200
@@ -158,7 +158,6 @@
         reconciliation.setAPRMProcessReconciliationForce("P");
         OBDal.getInstance().save(reconciliation);
         OBDal.getInstance().flush();
-        Boolean invoicePaidold = false;
       }
       reconciliation.setProcessNow(false);
       OBDal.getInstance().save(reconciliation);
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Sat May 30 20:29:02 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Sat May 30 20:59:23 2015 +0200
@@ -1245,7 +1245,6 @@
 
   public static boolean periodControlOpened(String tableName, String recordId, String idColumnName,
       String orgType) {
-    final Session session = OBDal.getInstance().getSession();
 
     List<Object> parameters = new ArrayList<Object>();
     parameters.add(tableName);
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java	Sat May 30 20:29:02 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java	Sat May 30 20:59:23 2015 +0200
@@ -1070,8 +1070,6 @@
     }
 
     Entity parentEntity = parentRecord.getEntity();
-    Entity entity = ModelProvider.getInstance().getEntityByTableId(
-        field.getTab().getTable().getId());
     Property property = KernelUtils.getProperty(field);
     Entity referencedEntity = property.getReferencedProperty().getEntity();
     return referencedEntity.equals(parentEntity);
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java	Sat May 30 20:29:02 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java	Sat May 30 20:59:23 2015 +0200
@@ -895,7 +895,6 @@
     private String displaylogicgrid = "";
 
     private int gridSort = 0;
-    private String id;
 
     public String getOnChangeFunction() {
       return field.getOnChangeFunction();
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java	Sat May 30 20:29:02 2015 +0200
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java	Sat May 30 20:59:23 2015 +0200
@@ -27,7 +27,6 @@
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.model.Entity;
-import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.model.Property;
 import org.openbravo.base.model.domaintype.DateDomainType;
 import org.openbravo.base.model.domaintype.DatetimeDomainType;
@@ -252,7 +251,6 @@
                   + "          and exists (from ADWindowAccess wa where f.tab.window = wa.window and wa.role.id = :roleId and wa.editableField = false and wa.active = true)))");
       fieldQuery.setNamedParameter("tabId", tab.getId());
       fieldQuery.setNamedParameter("roleId", roleId);
-      final Entity entity = ModelProvider.getInstance().getEntity(entityName);
       for (Field f : fieldQuery.list()) {
         String key = KernelUtils.getProperty(f).getName();
         if (data.has(key)) {
--- a/src-core/src/org/openbravo/xmlEngine/XmlVectorValue.java	Sat May 30 20:29:02 2015 +0200
+++ b/src-core/src/org/openbravo/xmlEngine/XmlVectorValue.java	Sat May 30 20:59:23 2015 +0200
@@ -52,7 +52,6 @@
         if (xmlComponentValue.print() != null && !xmlComponentValue.print().startsWith("<")
             && !xmlComponentValue.print().equals("")) {
 
-          boolean isTranslated = false;
           result = xmlComponentValue.print().replace(String.valueOf((char) 160), " ").trim();
           log4jXmlVectorValue.debug("printStringBuffer(HashMap<String, String> textMap) - result: "
               + result);
--- a/src-test/src/org/openbravo/test/dal/DalPerformanceExampleTest.java	Sat May 30 20:29:02 2015 +0200
+++ b/src-test/src/org/openbravo/test/dal/DalPerformanceExampleTest.java	Sat May 30 20:59:23 2015 +0200
@@ -159,7 +159,6 @@
 
     // get the id and entityname in a way which does not load the object
     final Object id = DalUtil.getId(category);
-    final String entityName = DalUtil.getEntityName(category);
 
     // still unloaded
     Assert.assertTrue(((HibernateProxy) category).getHibernateLazyInitializer().isUninitialized());
--- a/src-wad/src/org/openbravo/wad/Wad.java	Sat May 30 20:29:02 2015 +0200
+++ b/src-wad/src/org/openbravo/wad/Wad.java	Sat May 30 20:59:23 2015 +0200
@@ -995,7 +995,6 @@
       }
 
       int parentTabIndex = -1;
-      boolean sinParent = false;
       String grandfatherField = "";
       if (allTabs != null && allTabs.length > 0)
         parentTabIndex = parentTabId(allTabs, tabsData.tabid);
@@ -1012,7 +1011,6 @@
       if (parentTabIndex != -1 && (parentsFieldsData == null || parentsFieldsData.length == 0)) {
         parentsFieldsData = FieldsData.parentsColumnReal(pool, allTabs[parentTabIndex].tabid,
             tabsData.tabid);
-        sinParent = true;
         if (parentsFieldsData == null || parentsFieldsData.length == 0) {
           log4j.info("No key found in parent tab: " + allTabs[parentTabIndex].tabname);
         }
--- a/src/org/openbravo/base/model/ModelProvider.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/base/model/ModelProvider.java	Sat May 30 20:59:23 2015 +0200
@@ -204,7 +204,6 @@
         if (TABLEBASEDTABLE.equals(t.getDataOrigin())) {
           tablesByTableName.put(t.getTableName().toLowerCase(), t);
         } else {
-          String dataOrigin = t.getDataOrigin();
           dataSourceTablesByName.put(t.getName().toLowerCase(), t);
         }
       }
--- a/src/org/openbravo/common/actionhandler/RMInOutPickEditLines.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/common/actionhandler/RMInOutPickEditLines.java	Sat May 30 20:59:23 2015 +0200
@@ -27,9 +27,7 @@
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.provider.OBProvider;
-import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.client.application.process.BaseProcessActionHandler;
-import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBDao;
@@ -70,7 +68,6 @@
 
     } catch (Exception e) {
       log.error(e.getMessage(), e);
-      VariablesSecureApp vars = RequestContext.get().getVariablesSecureApp();
 
       try {
         jsonRequest = new JSONObject();
--- a/src/org/openbravo/common/actionhandler/RMShipmentPickEditLines.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/common/actionhandler/RMShipmentPickEditLines.java	Sat May 30 20:59:23 2015 +0200
@@ -28,9 +28,7 @@
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.provider.OBProvider;
-import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.client.application.process.BaseProcessActionHandler;
-import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBDao;
@@ -71,7 +69,6 @@
 
     } catch (Exception e) {
       log.error(e.getMessage(), e);
-      VariablesSecureApp vars = RequestContext.get().getVariablesSecureApp();
 
       try {
         jsonRequest = new JSONObject();
--- a/src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java	Sat May 30 20:59:23 2015 +0200
@@ -1288,7 +1288,6 @@
     }
 
     for (Object o : query.list()) {
-      Map<String, Object> myMap = new HashMap<String, Object>();
       StorageDetail sd = (StorageDetail) o;
       if (selectedIds.size() > 0) {
         for (int i = 0; i < selectedIds.size(); i++) {
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java	Sat May 30 20:59:23 2015 +0200
@@ -1739,7 +1739,6 @@
             String strLocator = vars.getStringParameter("inpmLocatorId" + strLineId);
             final String strmAttributesetinstanceId = vars
                 .getStringParameter("inpmAttributesetinstanceId" + strLineId);
-            final String strcUomIdConversion = "";
             String strbreakdown = "";
             CreateFromShipmentData[] dataUomIdConversion = null;
 
--- a/src/org/openbravo/erpCommon/ad_actionButton/EditCCPMeasureValues.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/EditCCPMeasureValues.java	Sat May 30 20:59:23 2015 +0200
@@ -61,7 +61,6 @@
       String strTabId = vars.getStringParameter("inpTabId");
       String[] strValueId = request.getParameterValues("strKey");
       String[] strGroupId = request.getParameterValues("strGroup");
-      ActionButtonDefaultData[] tab = ActionButtonDefaultData.windowName(this, strTabId);
 
       String strWindowPath = Utility.getTabURL(strTabId, "R", true);
       if (strWindowPath.equals(""))
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Asset_Product.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Asset_Product.java	Sat May 30 20:59:23 2015 +0200
@@ -45,7 +45,6 @@
       ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
     if (vars.commandIn("DEFAULT")) {
-      String strChanged = vars.getStringParameter("inpLastFieldChanged");
       String strTabId = vars.getStringParameter("inpTabId");
 
       String strMProductID = vars.getStringParameter("inpmProductId");
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_PC_Case_Product.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_PC_Case_Product.java	Sat May 30 20:59:23 2015 +0200
@@ -48,7 +48,6 @@
       ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
     if (vars.commandIn("DEFAULT")) {
-      String strChanged = vars.getStringParameter("inpLastFieldChanged");
       String strTabId = vars.getStringParameter("inpTabId");
 
       String strMProductID = vars.getStringParameter("inpmProductId");
--- a/src/org/openbravo/erpCommon/ad_process/DeleteClient.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/DeleteClient.java	Sat May 30 20:59:23 2015 +0200
@@ -34,7 +34,6 @@
 import org.openbravo.erpCommon.utility.LeftTabsBar;
 import org.openbravo.erpCommon.utility.NavigationBar;
 import org.openbravo.erpCommon.utility.OBError;
-import org.openbravo.erpCommon.utility.SequenceIdData;
 import org.openbravo.erpCommon.utility.ToolBar;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.ad.system.Client;
@@ -66,7 +65,6 @@
   }
 
   private void processButton(VariablesSecureApp vars, String strClient) throws ServletException {
-    String pinstance = SequenceIdData.getUUID();
     OBError myMessage = null;
     try {
       if (strClient.equals("")) {
--- a/src/org/openbravo/erpCommon/ad_process/ResetAccountingProcess.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ResetAccountingProcess.java	Sat May 30 20:59:23 2015 +0200
@@ -25,16 +25,12 @@
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.financial.ResetAccounting;
 import org.openbravo.scheduling.ProcessBundle;
-import org.openbravo.scheduling.ProcessLogger;
 import org.openbravo.service.db.DalBaseProcess;
 import org.quartz.JobExecutionException;
 
 public class ResetAccountingProcess extends DalBaseProcess {
 
-  private ProcessLogger logger;
-
   public void doExecute(ProcessBundle bundle) throws Exception {
-    logger = bundle.getLogger();
     try {
       String adClientId = (String) bundle.getParams().get("adClientId");
       String adOrgId = (String) bundle.getParams().get("adOrgId");
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java	Sat May 30 20:59:23 2015 +0200
@@ -544,7 +544,6 @@
       ServletException {
     log4j.debug("Output: PDF");
     response.setContentType("text/html; charset=UTF-8");
-    ReportGeneralLedgerData[] subreport = null;
     String strTreeOrg = TreeData.getTreeOrg(this, vars.getClient());
     String strOrgFamily = getFamily(strTreeOrg, strOrg);
     String toDatePlusOne = DateTimeData.nDaysAfter(this, strDateTo, "1");
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR.java	Sat May 30 20:59:23 2015 +0200
@@ -651,14 +651,12 @@
     levelsconcat.append("''");
     String[] strLevelLabel = { "", "", "", "", "", "", "", "", "", "" };
     String[] strTextShow = { "", "", "", "", "", "", "", "", "", "" };
-    int intDiscard = 0;
     int intOrder = 0;
     int intProductLevel = 11;
     int intAuxDiscard = -1;
     for (int i = 0; i < 10; i++) {
       if (strShownArray[i].equals("1")) {
         strTextShow[i] = "C_BP_GROUP.NAME";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[0].name;
         levelsconcat.append(" || ");
@@ -666,14 +664,12 @@
       } else if (strShownArray[i].equals("2")) {
         strTextShow[i] = "AD_COLUMN_IDENTIFIER(to_char('C_Bpartner'), to_char( C_BPARTNER.C_BPARTNER_ID), to_char( '"
             + vars.getLanguage() + "'))";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[1].name;
         levelsconcat.append(" || ");
         levelsconcat.append("C_BPARTNER.C_BPARTNER_ID");
       } else if (strShownArray[i].equals("3")) {
         strTextShow[i] = "M_PRODUCT_CATEGORY.NAME";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[2].name;
         levelsconcat.append(" || ");
@@ -690,21 +686,18 @@
         levelsconcat.append("M_PRODUCT.M_PRODUCT_ID");
       } else if (strShownArray[i].equals("5")) {
         strTextShow[i] = "C_INVOICE.DOCUMENTNO";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[4].name;
         levelsconcat.append(" || ");
         levelsconcat.append("C_INVOICE.C_INVOICE_ID");
       } else if (strShownArray[i].equals("6")) {
         strTextShow[i] = "AD_USER.FIRSTNAME||' '||' '||AD_USER.LASTNAME";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[5].name;
         levelsconcat.append(" || ");
         levelsconcat.append("AD_USER.AD_USER_ID");
       } else if (strShownArray[i].equals("8")) {
         strTextShow[i] = "AD_ORG.NAME";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[6].name;
         levelsconcat.append(" || ");
@@ -712,14 +705,12 @@
       } else if (strShownArray[i].equals("9")) {
         strTextShow[i] = "CASE WHEN AD_USER.AD_USER_ID IS NOT NULL THEN AD_COLUMN_IDENTIFIER(to_char('Ad_User'), to_char( AD_USER.AD_USER_ID), to_char( '"
             + vars.getLanguage() + "')) ELSE '' END";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[7].name;
         levelsconcat.append(" || ");
         levelsconcat.append("AD_USER.AD_USER_ID");
       } else if (strShownArray[i].equals("10")) {
         strTextShow[i] = "C_PROJECT.NAME";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[8].name;
         levelsconcat.append(" || ");
@@ -727,7 +718,6 @@
       } else if (strShownArray[i].equals("11")) {
         strTextShow[i] = "AD_COLUMN_IDENTIFIER(to_char('C_Bpartner_Location'), to_char( M_INOUT.C_BPARTNER_LOCATION_ID), to_char( '"
             + vars.getLanguage() + "'))";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[9].name;
         levelsconcat.append(" || ");
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR_legacy.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR_legacy.java	Sat May 30 20:59:23 2015 +0200
@@ -518,14 +518,12 @@
     levelsconcat.append("''");
     String[] strLevelLabel = { "", "", "", "", "", "", "", "", "", "" };
     String[] strTextShow = { "", "", "", "", "", "", "", "", "", "" };
-    int intDiscard = 0;
     int intOrder = 0;
     int intProductLevel = 11;
     int intAuxDiscard = -1;
     for (int i = 0; i < 10; i++) {
       if (strShownArray[i].equals("1")) {
         strTextShow[i] = "C_BP_GROUP.NAME";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[0].name;
         levelsconcat.append(" || ");
@@ -533,14 +531,12 @@
       } else if (strShownArray[i].equals("2")) {
         strTextShow[i] = "AD_COLUMN_IDENTIFIER(to_char('C_Bpartner'), to_char( C_BPARTNER.C_BPARTNER_ID), to_char( '"
             + vars.getLanguage() + "'))";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[1].name;
         levelsconcat.append(" || ");
         levelsconcat.append("C_BPARTNER.C_BPARTNER_ID");
       } else if (strShownArray[i].equals("3")) {
         strTextShow[i] = "M_PRODUCT_CATEGORY.NAME";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[2].name;
         levelsconcat.append(" || ");
@@ -557,21 +553,18 @@
         levelsconcat.append("M_PRODUCT.M_PRODUCT_ID");
       } else if (strShownArray[i].equals("5")) {
         strTextShow[i] = "C_INVOICE.DOCUMENTNO";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[4].name;
         levelsconcat.append(" || ");
         levelsconcat.append("C_INVOICE.C_INVOICE_ID");
       } else if (strShownArray[i].equals("6")) {
         strTextShow[i] = "AD_USER.FIRSTNAME||' '||' '||AD_USER.LASTNAME";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[5].name;
         levelsconcat.append(" || ");
         levelsconcat.append("AD_USER.AD_USER_ID");
       } else if (strShownArray[i].equals("8")) {
         strTextShow[i] = "AD_ORG.NAME";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[6].name;
         levelsconcat.append(" || ");
@@ -579,14 +572,12 @@
       } else if (strShownArray[i].equals("9")) {
         strTextShow[i] = "CASE WHEN AD_USER.AD_USER_ID IS NOT NULL THEN AD_COLUMN_IDENTIFIER(to_char('Ad_User'), to_char( AD_USER.AD_USER_ID), to_char( '"
             + vars.getLanguage() + "')) ELSE '' END";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[7].name;
         levelsconcat.append(" || ");
         levelsconcat.append("AD_USER.AD_USER_ID");
       } else if (strShownArray[i].equals("10")) {
         strTextShow[i] = "C_PROJECT.NAME";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[8].name;
         levelsconcat.append(" || ");
@@ -594,7 +585,6 @@
       } else if (strShownArray[i].equals("11")) {
         strTextShow[i] = "AD_COLUMN_IDENTIFIER(to_char('C_Bpartner_Location'), to_char( M_INOUT.C_BPARTNER_LOCATION_ID), to_char( '"
             + vars.getLanguage() + "'))";
-        intDiscard++;
         intOrder++;
         strLevelLabel[i] = dimensionLabel[9].name;
         levelsconcat.append(" || ");
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java	Sat May 30 20:59:23 2015 +0200
@@ -566,8 +566,6 @@
 
         HashMap<String, Object> parameters = new HashMap<String, Object>();
 
-        String strLanguage = vars.getLanguage();
-
         StringBuilder strSubTitle = new StringBuilder();
 
         strSubTitle.append(Utility.messageBD(this, "LegalEntity", vars.getLanguage()) + ": ");
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java	Sat May 30 20:59:23 2015 +0200
@@ -315,7 +315,6 @@
             createPrintOptionsPage(request, response, vars, documentType,
                 getComaSeparatedString(documentIds), reports);
           else {
-            final boolean showList = true;
             createEmailOptionsPage(request, response, vars, documentType,
                 getComaSeparatedString(documentIds), reports, checks, fullDocumentIdentifier);
           }
@@ -842,7 +841,6 @@
     xmlDocument.setParameter("strDocumentId", strDocumentId);
 
     // Get additional document information
-    final String draftDocumentIds = "";
     String strIsDirectPDF = vars.getStringParameter("isDirectPDF");
     if (strIsDirectPDF == null || "".equals(strIsDirectPDF)) {
       strIsDirectPDF = "false";
--- a/src/org/openbravo/event/InvoiceLineEventHandler.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/event/InvoiceLineEventHandler.java	Sat May 30 20:59:23 2015 +0200
@@ -26,16 +26,14 @@
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.client.kernel.event.EntityDeleteEvent;
 import org.openbravo.client.kernel.event.EntityPersistenceEventObserver;
-import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
-import org.openbravo.database.ConnectionProvider;
 import org.openbravo.model.common.invoice.Invoice;
 import org.openbravo.model.common.invoice.InvoiceLine;
-import org.openbravo.service.db.DalConnectionProvider;
 
 public class InvoiceLineEventHandler extends EntityPersistenceEventObserver {
-  private static Entity[] entities = { ModelProvider.getInstance().getEntity(InvoiceLine.ENTITY_NAME) };
+  private static Entity[] entities = { ModelProvider.getInstance().getEntity(
+      InvoiceLine.ENTITY_NAME) };
   protected Logger logger = Logger.getLogger(this.getClass());
 
   @Override
@@ -51,14 +49,13 @@
   }
 
   private void checkInvoiceLineRelation(InvoiceLine ObjInvoiceLine) {
-    ConnectionProvider conn = new DalConnectionProvider(false);
-    String language = OBContext.getOBContext().getLanguage().getLanguage();
     OBCriteria<InvoiceLine> criteria = OBDal.getInstance().createCriteria(InvoiceLine.class);
-    criteria.add(Restrictions.eq(InvoiceLine.PROPERTY_INVOICE,ObjInvoiceLine.getInvoice()));
+    criteria.add(Restrictions.eq(InvoiceLine.PROPERTY_INVOICE, ObjInvoiceLine.getInvoice()));
 
     if (criteria.count() == 1) {
-      Invoice ObjInvoice = OBDal.getInstance().get(Invoice.class,ObjInvoiceLine.getInvoice().getId());
-      
+      Invoice ObjInvoice = OBDal.getInstance().get(Invoice.class,
+          ObjInvoiceLine.getInvoice().getId());
+
       if (ObjInvoice != null) {
         ObjInvoice.setSalesOrder(null);
         OBDal.getInstance().save(ObjInvoice);
--- a/src/org/openbravo/event/MInOutLineEventHandler.java	Sat May 30 20:29:02 2015 +0200
+++ b/src/org/openbravo/event/MInOutLineEventHandler.java	Sat May 30 20:59:23 2015 +0200
@@ -29,14 +29,11 @@
 import org.openbravo.client.kernel.event.EntityNewEvent;
 import org.openbravo.client.kernel.event.EntityPersistenceEventObserver;
 import org.openbravo.client.kernel.event.EntityUpdateEvent;
-import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
-import org.openbravo.database.ConnectionProvider;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.model.materialmgmt.transaction.ShipmentInOut;
 import org.openbravo.model.materialmgmt.transaction.ShipmentInOutLine;
-import org.openbravo.service.db.DalConnectionProvider;
 
 public class MInOutLineEventHandler extends EntityPersistenceEventObserver {
   private static Entity[] entities = { ModelProvider.getInstance().getEntity(
@@ -54,10 +51,11 @@
     }
     ShipmentInOutLine shipmentInOutLine = (ShipmentInOutLine) event.getTargetInstance();
 
-    if (shipmentInOutLine.getProduct() == null &&  (shipmentInOutLine.getMovementQuantity().doubleValue() != 0) ){
-          throw new OBException(OBMessageUtils.messageBD("ProductNullAndMovementQtyGreaterZero"));
+    if (shipmentInOutLine.getProduct() == null
+        && (shipmentInOutLine.getMovementQuantity().doubleValue() != 0)) {
+      throw new OBException(OBMessageUtils.messageBD("ProductNullAndMovementQtyGreaterZero"));
     }
- }
+  }
 
   public void onUpdate(@Observes EntityUpdateEvent event) {
     if (!isValidEvent(event)) {
@@ -65,10 +63,12 @@
     }
     ShipmentInOutLine shipmentInOutLine = (ShipmentInOutLine) event.getTargetInstance();
 
-    if (shipmentInOutLine.getProduct()== null && (shipmentInOutLine.getMovementQuantity().doubleValue() != 0)){
-        throw new OBException(OBMessageUtils.messageBD("ProductNullAndMovementQtyGreaterZero"));
-     }
-}
+    if (shipmentInOutLine.getProduct() == null
+        && (shipmentInOutLine.getMovementQuantity().doubleValue() != 0)) {
+      throw new OBException(OBMessageUtils.messageBD("ProductNullAndMovementQtyGreaterZero"));
+    }
+  }
+
   public void onDelete(@Observes EntityDeleteEvent event) {
     if (!isValidEvent(event)) {
       return;
@@ -77,8 +77,6 @@
   }
 
   private void checkShipmentOrderRelation(ShipmentInOutLine shipmentInOutLine) {
-    ConnectionProvider conn = new DalConnectionProvider(false);
-    String language = OBContext.getOBContext().getLanguage().getLanguage();
     OBCriteria<ShipmentInOutLine> criteria = OBDal.getInstance().createCriteria(
         ShipmentInOutLine.class);
     criteria.add(Restrictions.eq(ShipmentInOutLine.PROPERTY_SHIPMENTRECEIPT,