Fixed 30052. Cleanup all 'Unnecessary cast' warnings from Eclipse.
authorStefan Hühner <stefan.huehner@openbravo.com>
Sat, 30 May 2015 19:57:13 +0200
changeset 26838 56776f691f4b
parent 26837 eef37b346fe4
child 26839 adda5d230a5e
Fixed 30052. Cleanup all 'Unnecessary cast' warnings from Eclipse.

As those extra casts are not useful and make the code harder to read/understand
-> Remove all those
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddOrderOrInvoiceFilterExpressionHandler.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/GlobalMenu.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/MultipleDeleteActionHandler.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/event/RemoveImagesEventHandler.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TreeTablesEventHandler.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/event/UpdateInvariantCharacteristicsHandler.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java
modules/org.openbravo.client.application/src/org/openbravo/client/application/personalization/PersonalizationHandler.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/ImagesActionHandler.java
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponentProvider.java
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServiceProvider.java
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/NoteDataSource.java
modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java
modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java
src-core/src/org/openbravo/base/VariablesBase.java
src-test/src/org/openbravo/test/dal/ADCachedMultiThreadTest.java
src-test/src/org/openbravo/test/xml/EntityXMLIssues.java
src/org/openbravo/base/model/Column.java
src/org/openbravo/base/model/ModelProvider.java
src/org/openbravo/base/session/OBYesNoType.java
src/org/openbravo/base/structure/IdentifierProvider.java
src/org/openbravo/common/actionhandler/KillProcess.java
src/org/openbravo/common/datasource/ResultMapCriteriaUtils.java
src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java
src/org/openbravo/costing/CostingAlgorithm.java
src/org/openbravo/costing/CostingMigrationProcess.java
src/org/openbravo/costing/CostingRuleProcess.java
src/org/openbravo/costing/CostingRuleProcessOnProcessHandler.java
src/org/openbravo/costing/InventoryAmountUpdateProcess.java
src/org/openbravo/costing/LCMatchingProcess.java
src/org/openbravo/costing/LandedCostDistributionByAmount.java
src/org/openbravo/costing/LandedCostProcess.java
src/org/openbravo/dal/security/SecurityChecker.java
src/org/openbravo/dal/service/OBDao.java
src/org/openbravo/dal/xml/EntityExcelXMLConverter.java
src/org/openbravo/dal/xml/EntityXMLConverter.java
src/org/openbravo/erpCommon/ad_actionButton/ExportReferenceData.java
src/org/openbravo/erpCommon/ad_callouts/SL_SequenceProduct_Product_Attribute.java
src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java
src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData.java
src/org/openbravo/erpCommon/ad_process/MRPPurchaseCreateReservations.java
src/org/openbravo/erpCommon/ad_process/RegisterModule.java
src/org/openbravo/erpCommon/businessUtility/InitialClientSetup.java
src/org/openbravo/erpCommon/info/ImageInfoBLOB.java
src/org/openbravo/erpCommon/modules/ImportModule.java
src/org/openbravo/erpCommon/modules/VersionUtility.java
src/org/openbravo/erpCommon/utility/GenericTree.java
src/org/openbravo/erpCommon/utility/Utility.java
src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java
src/org/openbravo/erpReports/ReportVatRegisterJR.java
src/org/openbravo/materialmgmt/InventoryCountProcess.java
src/org/openbravo/materialmgmt/VariantAutomaticGenerationProcess.java
src/org/openbravo/materialmgmt/VariantChDescUpdateProcess.java
src/org/openbravo/service/db/CallProcess.java
src/org/openbravo/service/db/DataImportService.java
src/org/openbravo/service/importprocess/ImportProcessUtils.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java	Sat May 30 19:57:13 2015 +0200
@@ -121,7 +121,7 @@
     int cont = 0;
     String differentPaymentMethod = "false";
     for (int i = 0; i < selectedLines.length(); i++) {
-      JSONObject selectedLine = selectedLines.getJSONObject((int) i);
+      JSONObject selectedLine = selectedLines.getJSONObject(i);
       log.debug(selectedLine);
       BigDecimal paidAmount = new BigDecimal(selectedLine.getString("payment"));
 
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddOrderOrInvoiceFilterExpressionHandler.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddOrderOrInvoiceFilterExpressionHandler.java	Sat May 30 19:57:13 2015 +0200
@@ -83,7 +83,7 @@
     AddPaymentDefaultValuesHandler handler = getDefaultsHandler(strWindowId);
     String paymentMethodId = handler.getDefaultPaymentMethod(requestMap);
     if (context.has("inpfinPaymentId") && context.get("inpfinPaymentId") != JSONObject.NULL
-        && StringUtils.isNotBlank((String) context.getString("inpfinPaymentId"))) {
+        && StringUtils.isNotBlank(context.getString("inpfinPaymentId"))) {
       if (hasDetailsWithDifferentPaymentMethods((String) context.get("inpfinPaymentId"))) {
         return "";
       } else {
@@ -111,7 +111,7 @@
     query.setParameter("paymentId", paymentId);
     FIN_Payment payment = OBDal.getInstance().get(FIN_Payment.class, paymentId);
     for (Object pmId : query.list()) {
-      if (!payment.getPaymentMethod().getId().equals((String) pmId)) {
+      if (!payment.getPaymentMethod().getId().equals(pmId)) {
         return true;
       }
     }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Sat May 30 19:57:13 2015 +0200
@@ -42,7 +42,7 @@
       final VariablesSecureApp vars = bundle.getContext().toVars();
       final ConnectionProvider conProvider = bundle.getConnection();
       final String language = bundle.getContext().getLanguage();
-      final boolean isForceProcess = (Boolean) "2DDE7D3618034C38A4462B7F3456C28D".equals(bundle
+      final boolean isForceProcess = "2DDE7D3618034C38A4462B7F3456C28D".equals(bundle
           .getProcessId());
 
       bankStatement.setProcessNow(true);
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java	Sat May 30 19:57:13 2015 +0200
@@ -111,7 +111,7 @@
           bundle.setResult(msg);
           return;
         }
-        final boolean isForceProcess = (Boolean) "6BF16EFC772843AC9A17552AE0B26AB7".equals(bundle
+        final boolean isForceProcess = "6BF16EFC772843AC9A17552AE0B26AB7".equals(bundle
             .getProcessId());
         // Transaction exists
         if (!isForceProcess && !MatchTransactionDao.islastreconciliation(reconciliation)) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Sat May 30 19:57:13 2015 +0200
@@ -425,7 +425,7 @@
         if (!businessPartnersScroll.next()) {
           String strParnterId = "";
           if (resultObject.getClass().isArray()) {
-            final Object[] values = (Object[]) resultObject;
+            final Object[] values = resultObject;
             strParnterId = (String) values[0];
           }
           BusinessPartner bp = OBDal.getInstance().get(BusinessPartner.class, strParnterId);
@@ -454,7 +454,7 @@
 
       String targetBusinessPartnerName = "";
       if (resultObject.getClass().isArray()) {
-        final Object[] values = (Object[]) resultObject;
+        final Object[] values = resultObject;
         targetBusinessPartnerId = (String) values[0];
         targetBusinessPartnerName = (String) values[1];
       }
@@ -481,7 +481,7 @@
         String bpName = "";
         resultObject = (Object[]) businessPartners.get(0);
         if (resultObject.getClass().isArray()) {
-          final Object[] values = (Object[]) resultObject;
+          final Object[] values = resultObject;
           bpId = (String) values[0];
           bpName = (String) values[1];
         }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Sat May 30 19:57:13 2015 +0200
@@ -1059,7 +1059,7 @@
       invoiceDocNo = invoice.getDocumentNo();
 
       final String paymentDescription = OBDal.getInstance()
-          .get(OrganizationInformation.class, ((String) DalUtil.getId(organization)))
+          .get(OrganizationInformation.class, (DalUtil.getId(organization)))
           .getAPRMPaymentDescription();
       // In case of a purchase invoice and the Supplier Reference is selected use Reference
       if (paymentDescription.equals("Supplier Reference") && !invoice.isSalesTransaction()) {
@@ -1255,7 +1255,7 @@
     Object result = CallStoredProcedure.getInstance().call("ad_get_doc_le_bu", parameters, null,
         false, true);
 
-    Organization org = OBDal.getInstance().get(Organization.class, (String) result);
+    Organization org = OBDal.getInstance().get(Organization.class, result);
 
     return org.getOrganizationType().isLegalEntityWithAccounting();
   }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/GlobalMenu.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/GlobalMenu.java	Sat May 30 19:57:13 2015 +0200
@@ -120,7 +120,7 @@
     final String menuHql = "select m from ADMenu m left join fetch m.aDMenuTrlList where m.module.enabled=true";
     final Query menuQry = OBDal.getInstance().getSession().createQuery(menuHql);
     @SuppressWarnings("unchecked")
-    List<Menu> menus = (List<Menu>) menuQry.list();
+    List<Menu> menus = menuQry.list();
 
     List<TreeNode> nodes = treeNodes.list();
 
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/MultipleDeleteActionHandler.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/MultipleDeleteActionHandler.java	Sat May 30 19:57:13 2015 +0200
@@ -66,7 +66,7 @@
       DataSourceService dataSourceService = getCustomDataSourceService(entityName);
       for (int i = 0; i < ids.length(); i++) {
         if (dataSourceService == null) {
-          final BaseOBObject object = OBDal.getInstance().get(entityName, (String) ids.get(i));
+          final BaseOBObject object = OBDal.getInstance().get(entityName, ids.get(i));
           if (object != null) {
             OBDal.getInstance().remove(object);
             // https://issues.openbravo.com/view.php?id=21229#c51631
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java	Sat May 30 19:57:13 2015 +0200
@@ -138,21 +138,21 @@
     if (!checkRequestMap()) {
       return null;
     }
-    return (String) requestMap.get(OBBindingsConstants.WINDOW_ID_PARAM);
+    return requestMap.get(OBBindingsConstants.WINDOW_ID_PARAM);
   }
 
   public String getTabId() {
     if (!checkRequestMap()) {
       return null;
     }
-    return (String) requestMap.get(OBBindingsConstants.TAB_ID_PARAM);
+    return requestMap.get(OBBindingsConstants.TAB_ID_PARAM);
   }
 
   public String getCommandType() {
     if (!checkRequestMap()) {
       return null;
     }
-    return (String) requestMap.get(OBBindingsConstants.COMMAND_TYPE_PARAM);
+    return requestMap.get(OBBindingsConstants.COMMAND_TYPE_PARAM);
   }
 
   public Boolean isPosted() {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/WindowSettingsActionHandler.java	Sat May 30 19:57:13 2015 +0200
@@ -230,13 +230,13 @@
             if (settingValue instanceof List) {
               for (Object callbackExtra : (List<?>) settingValue) {
                 if (callbackExtra instanceof String) {
-                  extraCallbacks.put((String) callbackExtra);
+                  extraCallbacks.put(callbackExtra);
                 } else {
                   log4j.warn("You are trying to set a wrong instance of extraCallbacks");
                 }
               }
             } else if (settingValue instanceof String) {
-              extraCallbacks.put((String) settingValue);
+              extraCallbacks.put(settingValue);
             } else {
               log4j.warn("You are trying to set a wrong instance of extraCallbacks");
             }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/RemoveImagesEventHandler.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/RemoveImagesEventHandler.java	Sat May 30 19:57:13 2015 +0200
@@ -112,7 +112,7 @@
     for (Entity entity : ModelProvider.getInstance().getEntityWithImage().keySet()) {
       entityArray.add(entity);
     }
-    return (Entity[]) entityArray.toArray(new Entity[entityArray.size()]);
+    return entityArray.toArray(new Entity[entityArray.size()]);
   }
 
   // Check if this image is used by another product
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TreeTablesEventHandler.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/TreeTablesEventHandler.java	Sat May 30 19:57:13 2015 +0200
@@ -167,6 +167,6 @@
     for (Table treeTable : treeTableList) {
       entityArray.add(ModelProvider.getInstance().getEntityByTableId(treeTable.getId()));
     }
-    return (Entity[]) entityArray.toArray(new Entity[entityArray.size()]);
+    return entityArray.toArray(new Entity[entityArray.size()]);
   }
 }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/UpdateInvariantCharacteristicsHandler.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/UpdateInvariantCharacteristicsHandler.java	Sat May 30 19:57:13 2015 +0200
@@ -69,7 +69,7 @@
       final String action = request.getString("action");
 
       if ("INITIALIZE".equals(action)) {
-        String productId = (String) request.getString("productId");
+        String productId = request.getString("productId");
         Product product = OBDal.getInstance().get(Product.class, productId);
 
         // Retrieves all the product invariant characteristics
@@ -120,7 +120,7 @@
         response.put("productId", productId);
         return response;
       } else {
-        String productId = (String) request.getString("productId");
+        String productId = request.getString("productId");
         Product product = OBDal.getInstance().get(Product.class, productId);
         final JSONObject updatedValues = request.getJSONObject("updatedValues");
         final JSONObject existingProdChValues = request.getJSONObject("existingProdChValues");
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java	Sat May 30 19:57:13 2015 +0200
@@ -269,8 +269,8 @@
     final JSONArray jsonArray = new JSONArray();
     for (BaseOBObject bob : objects) {
       final JSONObject jsonArrayItem = new JSONObject();
-      jsonArrayItem.put(JsonConstants.ID, (String) bob.getId());
-      jsonArrayItem.put(JsonConstants.IDENTIFIER, (String) bob.getIdentifier());
+      jsonArrayItem.put(JsonConstants.ID, bob.getId());
+      jsonArrayItem.put(JsonConstants.IDENTIFIER, bob.getIdentifier());
       jsonArray.put(jsonArrayItem);
     }
     return jsonArray;
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/personalization/PersonalizationHandler.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/personalization/PersonalizationHandler.java	Sat May 30 19:57:13 2015 +0200
@@ -470,7 +470,7 @@
       } else {
         jsonObject = new JSONObject();
       }
-      jsonObject.put(target, (Object) jsonValue);
+      jsonObject.put(target, jsonValue);
       uiPersonalization.setValue(jsonObject.toString());
       OBDal.getInstance().save(uiPersonalization);
       return uiPersonalization;
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java	Sat May 30 19:57:13 2015 +0200
@@ -366,7 +366,7 @@
     OBQuery<Note> obq = OBDal.getInstance().createQuery(Note.class,
         " table.id=:tableId and record=:recordId");
     obq.setFilterOnReadableOrganization(false);
-    obq.setNamedParameter("tableId", (String) DalUtil.getId(tab.getTable()));
+    obq.setNamedParameter("tableId", DalUtil.getId(tab.getTable()));
     obq.setNamedParameter("recordId", rowId);
     return obq.count();
   }
@@ -403,11 +403,11 @@
       Object[] array = (Object[]) qobj;
       JSONObject obj = new JSONObject();
       try {
-        obj.put("name", (String) array[0]);
-        obj.put("id", (String) array[1]);
+        obj.put("name", array[0]);
+        obj.put("id", array[1]);
         obj.put("age", (new Date().getTime() - ((Date) array[2]).getTime()));
-        obj.put("updatedby", (String) array[3]);
-        obj.put("description", (String) array[4]);
+        obj.put("updatedby", array[3]);
+        obj.put("description", array[4]);
       } catch (JSONException e) {
         log.error("Error while reading attachments", e);
       }
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ImagesActionHandler.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ImagesActionHandler.java	Sat May 30 19:57:13 2015 +0200
@@ -71,8 +71,7 @@
       String parentObjectId = (String) parameters.get("parentObjectId");
       Entity entity = ModelProvider.getInstance().getEntityByTableName(table.getDBTableName());
       String propertyName = entity.getPropertyByColumnName(columnName).getName();
-      BaseOBObject parentObject = (BaseOBObject) OBDal.getInstance().get(entity.getName(),
-          parentObjectId);
+      BaseOBObject parentObject = OBDal.getInstance().get(entity.getName(), parentObjectId);
       parentObject.set(propertyName, null);
       return new JSONObject();
     } else if (parameters.get("command").equals("GETSIZE")) {
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java	Sat May 30 19:57:13 2015 +0200
@@ -173,7 +173,7 @@
    * @return an instance of clz
    */
   public <U extends Component> U createComponent(Class<U> clz) {
-    return (U) components.select(clz).get();
+    return components.select(clz).get();
   }
 
   /*
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponentProvider.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponentProvider.java	Sat May 30 19:57:13 2015 +0200
@@ -48,7 +48,7 @@
    * @return an instance of clz
    */
   protected <U extends Component> U getComponent(Class<U> clz) {
-    return (U) WeldUtils.getInstanceFromStaticBeanManager(clz);
+    return WeldUtils.getInstanceFromStaticBeanManager(clz);
   }
 
   public Module getModule() {
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java	Sat May 30 19:57:13 2015 +0200
@@ -435,7 +435,7 @@
     }
     List<Tab> subTabList = new ArrayList<Tab>();
     for (int i = 0; i < tabIds.length; i++) {
-      String tabId = ((KernelUtilsData) tabIds[i]).adTabId;
+      String tabId = tabIds[i].adTabId;
       Tab subTab = OBDal.getInstance().get(Tab.class, tabId);
       subTabList.add(subTab);
     }
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java	Sat May 30 19:57:13 2015 +0200
@@ -532,8 +532,8 @@
       if (!isListReference && "AD_ORG_ID".equals(field.getColumn().getDBColumnName().toUpperCase())
           && "".equals(columnValue) && vars.getStringParameter("CHANGED_COLUMN").equals(columnName)) {
         JSONObject entry = new JSONObject();
-        entry.put(JsonConstants.ID, (String) columnValue);
-        entry.put(JsonConstants.IDENTIFIER, (String) columnValue);
+        entry.put(JsonConstants.ID, columnValue);
+        entry.put(JsonConstants.IDENTIFIER, columnValue);
         return entry.toString();
       }
       boolean comboreload = rq.getRequestParameter("donotaddcurrentelement") != null
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java	Sat May 30 19:57:13 2015 +0200
@@ -1192,7 +1192,7 @@
       }
       OBContext.restorePreviousMode();
     }
-    return (FieldProvider[]) totalData.toArray(new FieldProvider[totalData.size()]);
+    return totalData.toArray(new FieldProvider[totalData.size()]);
   }
 
   /**
@@ -2102,7 +2102,7 @@
       final Session session = OBDal.getInstance().getSession();
       final Query query = session.createQuery(sql.toString());
       for (final Object o : query.list()) {
-        result.add(OBDal.getInstance().get(Invoice.class, (String) o));
+        result.add(OBDal.getInstance().get(Invoice.class, o));
       }
 
       return result;
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java	Sat May 30 19:57:13 2015 +0200
@@ -289,11 +289,11 @@
     int cont = 0;
     ScrollableResults scrollNodes = obq.createQuery().scroll(ScrollMode.FORWARD_ONLY);
     while (scrollNodes.next()) {
-      Object[] node = (Object[]) scrollNodes.get();
+      Object[] node = scrollNodes.get();
       JSONObject value = null;
       BaseOBObject bob = (BaseOBObject) node[ENTITY];
       try {
-        value = toJsonConverter.toJsonObject((BaseOBObject) bob, DataResolvingMode.FULL);
+        value = toJsonConverter.toJsonObject(bob, DataResolvingMode.FULL);
         value.put("nodeId", bob.getId().toString());
         if (fetchRoot) {
           value.put("parentId", ROOT_NODE_CLIENT);
@@ -649,7 +649,7 @@
       treeNodeCriteria.add(Restrictions.eq(TreeNode.PROPERTY_NODE, bobId));
       TreeNode treeNode = (TreeNode) treeNodeCriteria.uniqueResult();
       BaseOBObject bob = OBDal.getInstance().get(entity.getName(), treeNode.getNode());
-      json = toJsonConverter.toJsonObject((BaseOBObject) bob, DataResolvingMode.FULL);
+      json = toJsonConverter.toJsonObject(bob, DataResolvingMode.FULL);
       json.put("nodeId", bobId);
       if (treeNode.getReportSet() == null) {
         json.put("parentId", ROOT_NODE_CLIENT);
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServiceProvider.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServiceProvider.java	Sat May 30 19:57:13 2015 +0200
@@ -122,7 +122,7 @@
     final OBCriteria<Table> qTable = OBDal.getInstance().createCriteria(Table.class);
     qTable.add(Restrictions.eq(Table.PROPERTY_NAME, tableName));
     if (!qTable.list().isEmpty()) {
-      Table table = (Table) qTable.list().get(0);
+      Table table = qTable.list().get(0);
       if (ApplicationConstants.DATASOURCEBASEDTABLE.equals(table.getDataOriginType())) {
         // If the table is based on a manual datasource, return that particular datasource
         dataSource = table.getObserdsDatasource();
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java	Sat May 30 19:57:13 2015 +0200
@@ -112,7 +112,7 @@
         && parameters.containsKey(JsonConstants.TARGETRECORDID_PARAMETER)) {
       final String parentProperty = parameters.get(JsonConstants.FILTERBYPARENTPROPERTY_PARAMETER);
       final BaseOBObject bob = OBDal.getInstance().get(getEntity().getName(),
-          (String) parameters.get(JsonConstants.TARGETRECORDID_PARAMETER));
+          parameters.get(JsonConstants.TARGETRECORDID_PARAMETER));
 
       // a special case, a child tab actually displays the parent record
       // but a different set of information of that record
@@ -120,7 +120,7 @@
       if (bob.getId().equals(bob.get(parentProperty))) {
         parentId = (String) bob.getId();
       } else {
-        parentId = (String) DalUtil.getId((BaseOBObject) bob.get(parentProperty));
+        parentId = (String) DalUtil.getId(bob.get(parentProperty));
       }
 
       final String whereClause;
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java	Sat May 30 19:57:13 2015 +0200
@@ -286,8 +286,7 @@
     final ScrollableResults scrollableResults = query.scroll(ScrollMode.FORWARD_ONLY);
     while (scrollableResults.next()) {
       BaseOBObject bob = (BaseOBObject) scrollableResults.get()[0];
-      final JSONObject json = toJsonConverter.toJsonObject((BaseOBObject) bob,
-          DataResolvingMode.FULL);
+      final JSONObject json = toJsonConverter.toJsonObject(bob, DataResolvingMode.FULL);
       if (fetchRoot) {
         json.put("parentId", ROOT_NODE_CLIENT);
       } else {
@@ -465,8 +464,7 @@
     OBDal.getInstance().flush();
     final DataToJsonConverter toJsonConverter = OBProvider.getInstance().get(
         DataToJsonConverter.class);
-    JSONObject updatedData = toJsonConverter.toJsonObject((BaseOBObject) bob,
-        DataResolvingMode.FULL);
+    JSONObject updatedData = toJsonConverter.toJsonObject(bob, DataResolvingMode.FULL);
     addNodeCommonAttributes(entity, bob, updatedData);
     updatedData.put("parentId", newParentId);
     updatedData.put("_hasChildren", (this.nodeHasChildren(entity, linkToParentProperty,
@@ -601,7 +599,7 @@
 
     try {
       BaseOBObject bob = OBDal.getInstance().get(entity.getName(), bobId);
-      json = toJsonConverter.toJsonObject((BaseOBObject) bob, DataResolvingMode.FULL);
+      json = toJsonConverter.toJsonObject(bob, DataResolvingMode.FULL);
       if (fillNodeIdAndParentId) {
         String parentId = null;
         if (linkToParentProperty.isPrimitive()) {
@@ -615,7 +613,7 @@
         if (parentId != null) {
           json.put("parentId", parentId);
         } else {
-          json.put("parentId", (String) ROOT_NODE_CLIENT);
+          json.put("parentId", ROOT_NODE_CLIENT);
         }
         Object nodeId = bob.get(nodeIdProperty.getName());
         String nodeIdStr = null;
@@ -844,8 +842,7 @@
     final ScrollableResults scrollableResults = query.scroll(ScrollMode.FORWARD_ONLY);
     while (scrollableResults.next()) {
       BaseOBObject bob = (BaseOBObject) scrollableResults.get()[0];
-      final JSONObject json = toJsonConverter.toJsonObject((BaseOBObject) bob,
-          DataResolvingMode.FULL);
+      final JSONObject json = toJsonConverter.toJsonObject(bob, DataResolvingMode.FULL);
 
       Object nodeId = bob.get(nodeIdProperty.getName());
       String nodeIdStr = null;
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/NoteDataSource.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/NoteDataSource.java	Sat May 30 19:57:13 2015 +0200
@@ -94,7 +94,7 @@
     OBContext.setAdminMode(false);
     try {
       String noteId = parameters.get("id");
-      Note note = (Note) OBDal.getInstance().get(Note.class, noteId);
+      Note note = OBDal.getInstance().get(Note.class, noteId);
       Table table = note.getTable();
       String tableId = table.getId();
       String recordId = note.getRecord();
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java	Sat May 30 19:57:13 2015 +0200
@@ -141,7 +141,7 @@
   public List<JSONObject> toJsonObjects(List<BaseOBObject> bobs) {
     final List<JSONObject> jsonObjects = new ArrayList<JSONObject>();
     for (BaseOBObject bob : bobs) {
-      jsonObjects.add(toJsonObject((BaseOBObject) bob, DataResolvingMode.FULL));
+      jsonObjects.add(toJsonObject(bob, DataResolvingMode.FULL));
     }
     return jsonObjects;
   }
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java	Fri May 29 09:52:37 2015 +0200
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java	Sat May 30 19:57:13 2015 +0200
@@ -554,9 +554,9 @@
       if (value == null) {
         value = (BaseOBObject) OBProvider.getInstance().get(entity.getName());
         // put it here, it must be imported later as a real object
-        newObjects.put(key, (BaseOBObject) value);
+        newObjects.put(key, value);
       }
-      keyToObject.put(key, (BaseOBObject) value);
+      keyToObject.put(key, value);
     } else {
       value = (BaseOBObject) OBProvider.getInstance().get(entity.getName());
     }
@@ -615,9 +615,9 @@
       if (value == null) {
         value = (BaseOBObject) OBProvider.getInstance().get(entity.getName());
         // put it here, it must be imported later as a real object
-        newObjects.put(key, (BaseOBObject) value);
+        newObjects.put(key, value);
       }
-      keyToObject.put(key, (BaseOBObject) value);
+      keyToObject.put(key, value);
     } else {
       value = (BaseOBObject) OBProvider.getInstance().get(entity.getName());
     }
--- a/src-core/src/org/openbravo/base/VariablesBase.java	Fri May 29 09:52:37 2015 +0200
+++ b/src-core/src/org/openbravo/base/VariablesBase.java	Sat May 30 19:57:13 2015 +0200
@@ -1404,9 +1404,9 @@
     Object auxStr = null;
     try {
       if (session != null) {
-        auxStr = (Object) session.getAttribute(sessionAttribute.toUpperCase());
+        auxStr = session.getAttribute(sessionAttribute.toUpperCase());
       } else {
-        auxStr = (Object) sessionAttributes.get(sessionAttribute.toUpperCase());
+        auxStr = sessionAttributes.get(sessionAttribute.toUpperCase());
       }
     } catch (Exception e) {
       auxStr = null;
--- a/src-test/src/org/openbravo/test/dal/ADCachedMultiThreadTest.java	Fri May 29 09:52:37 2015 +0200
+++ b/src-test/src/org/openbravo/test/dal/ADCachedMultiThreadTest.java	Sat May 30 19:57:13 2015 +0200
@@ -178,7 +178,7 @@
     ArrayList<Callable<Long>> threads = new ArrayList<Callable<Long>>();
 
     @SuppressWarnings("unchecked")
-    List<String> tabIds = (List<String>) qTabs.list();
+    List<String> tabIds = qTabs.list();
     for (String tabId : tabIds) {
       threads.add(new TabLoader(adcs, tabId, false));
     }
--- a/src-test/src/org/openbravo/test/xml/EntityXMLIssues.java	Fri May 29 09:52:37 2015 +0200
+++ b/src-test/src/org/openbravo/test/xml/EntityXMLIssues.java	Sat May 30 19:57:13 2015 +0200
@@ -68,7 +68,7 @@
     addReadWriteAccess(Greeting.class);
 
     // only do one greeting
-    final Greeting greeting = (Greeting) OBProvider.getInstance().get(Greeting.class);
+    final Greeting greeting = OBProvider.getInstance().get(Greeting.class);
     final String id = "" + System.currentTimeMillis();
     greeting.setName("test" + id);
     greeting.setId(id);
--- a/src/org/openbravo/base/model/Column.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/base/model/Column.java	Sat May 30 19:57:13 2015 +0200
@@ -385,7 +385,7 @@
       return Collections.EMPTY_SET;
     }
     if (getDomainType() instanceof StringEnumerateDomainType) {
-      return (Set<String>) ((StringEnumerateDomainType) getDomainType()).getEnumerateValues();
+      return ((StringEnumerateDomainType) getDomainType()).getEnumerateValues();
     }
     return Collections.EMPTY_SET;
   }
--- a/src/org/openbravo/base/model/ModelProvider.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/base/model/ModelProvider.java	Sat May 30 19:57:13 2015 +0200
@@ -465,7 +465,7 @@
       throw new OBException("No instances of " + clazz.getName()
           + " in the database, has the database been created and filled with data?");
     }
-    return (T) list.get(0);
+    return list.get(0);
 
   }
 
--- a/src/org/openbravo/base/session/OBYesNoType.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/base/session/OBYesNoType.java	Sat May 30 19:57:13 2015 +0200
@@ -74,9 +74,9 @@
         return true;
       }
       if (x == null && y != null && y instanceof Boolean) {
-        return ((Boolean) y).booleanValue() == false;
+        return y.booleanValue() == false;
       } else if (y == null && x != null && x instanceof Boolean) {
-        return ((Boolean) x).booleanValue() == false;
+        return x.booleanValue() == false;
       }
 
       return super.areEqual(x, y);
--- a/src/org/openbravo/base/structure/IdentifierProvider.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/base/structure/IdentifierProvider.java	Sat May 30 19:57:13 2015 +0200
@@ -112,8 +112,7 @@
           value = ((BaseOBObject) referencedObject.get(property.getDisplayPropertyName()))
               .getIdentifier();
         } else {
-          value = ((BaseOBObject) referencedObject)
-              .get(property.getDisplayPropertyName(), language);
+          value = referencedObject.get(property.getDisplayPropertyName(), language);
         }
 
         // Assign displayColumnProperty to apply formatting if needed
--- a/src/org/openbravo/common/actionhandler/KillProcess.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/common/actionhandler/KillProcess.java	Sat May 30 19:57:13 2015 +0200
@@ -67,8 +67,7 @@
         if (jobProcessRunId.equals(strProcessRunId)) {
           // Job Found
           DefaultJob jobInstance = (DefaultJob) job.getJobInstance();
-          org.openbravo.scheduling.Process process = (org.openbravo.scheduling.Process) jobInstance
-              .getProcessInstance();
+          org.openbravo.scheduling.Process process = jobInstance.getProcessInstance();
           if (process instanceof KillableProcess) {
             // Kill Process
             ((KillableProcess) process).kill(jobInstance.getBundle());
--- a/src/org/openbravo/common/datasource/ResultMapCriteriaUtils.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/common/datasource/ResultMapCriteriaUtils.java	Sat May 30 19:57:13 2015 +0200
@@ -235,7 +235,7 @@
 
     if ("id".equals(strField)) {
       // ID is always equals
-      returnVal = mapValue != JSONObject.NULL && ((String) localValue).equals((String) mapValue);
+      returnVal = mapValue != JSONObject.NULL && ((String) localValue).equals(mapValue);
     } else if (filterIdentifier) {
       BaseOBObject currentVal = (BaseOBObject) mapValue;
       String strCurrValIdentifier = currentVal.getIdentifier();
--- a/src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java	Sat May 30 19:57:13 2015 +0200
@@ -112,7 +112,7 @@
       int endRow) {
     List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
     if (parameters.get(JsonConstants.DISTINCT_PARAMETER) != null) {
-      String distinct = (String) parameters.get(JsonConstants.DISTINCT_PARAMETER);
+      String distinct = parameters.get(JsonConstants.DISTINCT_PARAMETER);
       log4j.debug("Distinct param: " + distinct);
       if ("warehouse".equals(distinct)) {
         result = getWarehouseFilterData(parameters);
@@ -173,7 +173,7 @@
     for (Map<String, Object> record : data) {
       if (contains != null && !"".equals(contains)) {
         OrderLine purchaseOrderLine = OBDal.getInstance().get(OrderLine.class,
-            (String) record.get("purchaseOrderLine"));
+            record.get("purchaseOrderLine"));
         if (purchaseOrderLine.getIdentifier().contains(contains)) {
           continue;
         }
@@ -226,8 +226,7 @@
     ids.add("-");
     for (Map<String, Object> record : data) {
       if (contains != null && !"".equals(contains)) {
-        Warehouse warehouse = OBDal.getInstance().get(Warehouse.class,
-            (String) record.get("warehouse"));
+        Warehouse warehouse = OBDal.getInstance().get(Warehouse.class, record.get("warehouse"));
         if (warehouse.getIdentifier().contains(contains)) {
           continue;
         }
@@ -363,7 +362,7 @@
     ids.add("-");
     for (Map<String, Object> record : data) {
       if (contains != null && !"".equals(contains)) {
-        Locator locator = OBDal.getInstance().get(Locator.class, (String) record.get("storageBin"));
+        Locator locator = OBDal.getInstance().get(Locator.class, record.get("storageBin"));
         if (locator != null && locator.getIdentifier().contains(contains)) {
           continue;
         }
--- a/src/org/openbravo/costing/CostingAlgorithm.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/costing/CostingAlgorithm.java	Sat May 30 19:57:13 2015 +0200
@@ -549,7 +549,7 @@
     try {
       List<Object> params = new ArrayList<Object>();
       params.add(production.getId());
-      params.add((String) DalUtil.getId(OBContext.getOBContext().getUser()));
+      params.add(DalUtil.getId(OBContext.getOBContext().getUser()));
       CallStoredProcedure.getInstance().call("MA_PRODUCTION_COST", params, null, true, false);
 
     } catch (Exception e) {
--- a/src/org/openbravo/costing/CostingMigrationProcess.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/costing/CostingMigrationProcess.java	Sat May 30 19:57:13 2015 +0200
@@ -655,7 +655,7 @@
     try {
       while (trxs.next()) {
         MaterialTransaction trx = (MaterialTransaction) trxs.get(0);
-        if (!orgId.equals((String) DalUtil.getId(trx.getOrganization()))) {
+        if (!orgId.equals(DalUtil.getId(trx.getOrganization()))) {
           orgId = (String) DalUtil.getId(trx.getOrganization());
           Currency cur = FinancialUtils.getLegalEntityCurrency(trx.getOrganization());
           curId = cur.getId();
--- a/src/org/openbravo/costing/CostingRuleProcess.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/costing/CostingRuleProcess.java	Sat May 30 19:57:13 2015 +0200
@@ -182,7 +182,7 @@
     crQry.setFilterOnReadableOrganization(false);
     crQry.setNamedParameter("ruleOrg", rule.getOrganization());
     crQry.setMaxResult(1);
-    return (CostingRule) crQry.uniqueResult();
+    return crQry.uniqueResult();
   }
 
   private boolean existsTransactions(Set<String> naturalOrgs, Set<String> childOrgs) {
--- a/src/org/openbravo/costing/CostingRuleProcessOnProcessHandler.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/costing/CostingRuleProcessOnProcessHandler.java	Sat May 30 19:57:13 2015 +0200
@@ -141,7 +141,7 @@
     crQry.setFilterOnReadableOrganization(false);
     crQry.setNamedParameter("ruleOrg", rule.getOrganization());
     crQry.setMaxResult(1);
-    return (CostingRule) crQry.uniqueResult();
+    return crQry.uniqueResult();
   }
 
   private boolean existsTransactions(Set<String> naturalOrgs, Set<String> childOrgs) {
--- a/src/org/openbravo/costing/InventoryAmountUpdateProcess.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/costing/InventoryAmountUpdateProcess.java	Sat May 30 19:57:13 2015 +0200
@@ -86,8 +86,8 @@
         while (scrollLines.next()) {
           final InventoryAmountUpdateLine line = (InventoryAmountUpdateLine) scrollLines.get()[0];
           String lineId = line.getId();
-          CostingRule rule = CostingUtils.getCostDimensionRule((Organization) OBDal.getInstance()
-              .get(Organization.class, orgId), line.getReferenceDate());
+          CostingRule rule = CostingUtils.getCostDimensionRule(
+              OBDal.getInstance().get(Organization.class, orgId), line.getReferenceDate());
           String ruleId = rule.getId();
           OrganizationStructureProvider osp = OBContext.getOBContext()
               .getOrganizationStructureProvider(rule.getClient().getId());
--- a/src/org/openbravo/costing/LCMatchingProcess.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/costing/LCMatchingProcess.java	Sat May 30 19:57:13 2015 +0200
@@ -170,7 +170,7 @@
       Object[] receiptAmt = receiptamts.get();
       BigDecimal amt = (BigDecimal) receiptAmt[0];
       ShipmentInOutLine receiptLine = OBDal.getInstance().get(ShipmentInOutLine.class,
-          (String) receiptAmt[1]);
+          receiptAmt[1]);
       MaterialTransaction trx = receiptLine.getMaterialMgmtMaterialTransactionList().get(0);
       CostAdjustmentLine cal = CostAdjustmentUtils.insertCostAdjustmentLine(trx, ca, amt, true,
           referenceDate);
--- a/src/org/openbravo/costing/LandedCostDistributionByAmount.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/costing/LandedCostDistributionByAmount.java	Sat May 30 19:57:13 2015 +0200
@@ -89,7 +89,7 @@
     i = 0;
     while (receiptCosts.next()) {
       ShipmentInOutLine receiptline = OBDal.getInstance().get(ShipmentInOutLine.class,
-          (String) receiptCosts.get()[1]);
+          receiptCosts.get()[1]);
       String strTrxCurId = (String) receiptCosts.get()[2];
       BigDecimal trxAmt = (BigDecimal) receiptCosts.get()[3];
 
@@ -106,7 +106,7 @@
       }
       pendingAmt = pendingAmt.subtract(receiptAmt);
       LCReceipt lcrl = (LCReceipt) OBDal.getInstance().getProxy(LCReceipt.ENTITY_NAME,
-          (String) receiptCosts.get()[0]);
+          receiptCosts.get()[0]);
       LCReceiptLineAmt lcrla = OBProvider.getInstance().get(LCReceiptLineAmt.class);
       lcrla.setLandedCostCost((LandedCostCost) OBDal.getInstance().getProxy(
           LandedCostCost.ENTITY_NAME, lcCost.getId()));
--- a/src/org/openbravo/costing/LandedCostProcess.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/costing/LandedCostProcess.java	Sat May 30 19:57:13 2015 +0200
@@ -230,9 +230,9 @@
       log.debug("Process receipt amounts");
       Object[] receiptAmt = receiptamts.get();
       BigDecimal amt = (BigDecimal) receiptAmt[0];
-      Currency lcCostCurrency = OBDal.getInstance().get(Currency.class, (String) receiptAmt[1]);
+      Currency lcCostCurrency = OBDal.getInstance().get(Currency.class, receiptAmt[1]);
       ShipmentInOutLine receiptLine = OBDal.getInstance().get(ShipmentInOutLine.class,
-          (String) receiptAmt[2]);
+          receiptAmt[2]);
       // MaterialTransaction receiptLine = (MaterialTransaction) record[1];
       MaterialTransaction trx = receiptLine.getMaterialMgmtMaterialTransactionList().get(0);
       CostAdjustmentLine cal = CostAdjustmentUtils.insertCostAdjustmentLine(trx, ca, amt, true,
--- a/src/org/openbravo/dal/security/SecurityChecker.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/dal/security/SecurityChecker.java	Sat May 30 19:57:13 2015 +0200
@@ -219,8 +219,7 @@
     final Entity entity = ((BaseOBObject) organizationEnabledObject).getEntity();
 
     obContext.getEntityAccessChecker().checkReadable(entity);
-    String orgId = (String) DalUtil.getId(((OrganizationEnabled) organizationEnabledObject)
-        .getOrganization());
+    String orgId = (String) DalUtil.getId(organizationEnabledObject.getOrganization());
     String readableOrganizations[] = obContext.getReadableOrganizations();
     List<String> organizations = Arrays.asList(readableOrganizations);
     if (!organizations.contains(orgId)) {
--- a/src/org/openbravo/dal/service/OBDao.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/dal/service/OBDao.java	Sat May 30 19:57:13 2015 +0200
@@ -99,7 +99,7 @@
       StringTokenizer st = new StringTokenizer(strBaseOBOBjectIDs, ",", false);
       while (st.hasMoreTokens()) {
         String strBaseOBObjectID = st.nextToken().trim();
-        baseOBObjectList.add((T) OBDal.getInstance().get(t, strBaseOBObjectID));
+        baseOBObjectList.add(OBDal.getInstance().get(t, strBaseOBObjectID));
       }
     }
     return baseOBObjectList;
--- a/src/org/openbravo/dal/xml/EntityExcelXMLConverter.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/dal/xml/EntityExcelXMLConverter.java	Sat May 30 19:57:13 2015 +0200
@@ -184,7 +184,7 @@
             if (obValue == null) {
               txt = null;
             } else {
-              txt = ((BaseOBObject) obValue).getIdentifier();
+              txt = obValue.getIdentifier();
             }
           } else {
             txt = null;
--- a/src/org/openbravo/dal/xml/EntityXMLConverter.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/dal/xml/EntityXMLConverter.java	Sat May 30 19:57:13 2015 +0200
@@ -455,7 +455,7 @@
               // + treeNode.getId() + " is not valid, there is no " + referedEntity.getName()
               // + " with that id");
             } else {
-              addToExportList((BaseOBObject) obValue);
+              addToExportList(obValue);
             }
           }
         }
--- a/src/org/openbravo/erpCommon/ad_actionButton/ExportReferenceData.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/ExportReferenceData.java	Sat May 30 19:57:13 2015 +0200
@@ -82,7 +82,7 @@
   private OBError processButton(VariablesSecureApp vars, String strKey) {
     OBError myError = null;
     try {
-      DataSet myDataset = (DataSet) OBDal.getInstance().get(DataSet.class, strKey);
+      DataSet myDataset = OBDal.getInstance().get(DataSet.class, strKey);
       if (!myDataset.getModule().isInDevelopment()) {
         myError = new OBError();
         myError.setType("Error");
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_SequenceProduct_Product_Attribute.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_SequenceProduct_Product_Attribute.java	Sat May 30 19:57:13 2015 +0200
@@ -117,7 +117,7 @@
         org.openbravo.model.ad.domain.List.PROPERTY_REFERENCE, specialAttList));
     specialAttListValuesCriteria.add(Restrictions.eq(
         org.openbravo.model.ad.domain.List.PROPERTY_SEARCHKEY, Value));
-    java.util.List<org.openbravo.model.ad.domain.List> specialAttListValues = (java.util.List<List>) specialAttListValuesCriteria
+    java.util.List<org.openbravo.model.ad.domain.List> specialAttListValues = specialAttListValuesCriteria
         .list();
     if (specialAttListValues.isEmpty()) {
       return null;
--- a/src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java	Sat May 30 19:57:13 2015 +0200
@@ -1248,13 +1248,13 @@
         if (!islocal) {
           if (module != null
               && !Integer.toString(MaturityLevel.CS_MATURITY).equals(
-                  (String) module.getAdditionalInfo().get("maturity.level"))) {
+                  module.getAdditionalInfo().get("maturity.level"))) {
             discard[6] = "";
           } else {
             if (inst != null) {
               for (Module m : inst) {
                 if (!Integer.toString(MaturityLevel.CS_MATURITY).equals(
-                    (String) m.getAdditionalInfo().get("maturity.level"))) {
+                    m.getAdditionalInfo().get("maturity.level"))) {
                   discard[6] = "";
                 }
               }
@@ -1262,7 +1262,7 @@
             if (upd != null) {
               for (Module m : upd) {
                 if (!Integer.toString(MaturityLevel.CS_MATURITY).equals(
-                    (String) m.getAdditionalInfo().get("maturity.level"))) {
+                    m.getAdditionalInfo().get("maturity.level"))) {
                   discard[6] = "";
                 }
               }
@@ -1384,7 +1384,7 @@
 
       if (!check
           || Integer.toString(MaturityLevel.CS_MATURITY).equals(
-              (String) module.getAdditionalInfo().get("maturity.level"))) {
+              module.getAdditionalInfo().get("maturity.level"))) {
         xmlDocument.setParameter("maturityStyle", "none");
       } else {
         xmlDocument.setParameter("maturityStyle", "yes");
@@ -1456,7 +1456,7 @@
 
       if (!islocal) {
         if (Integer.toString(MaturityLevel.CS_MATURITY).equals(
-            (String) module.getAdditionalInfo().get("maturity.level"))) {
+            module.getAdditionalInfo().get("maturity.level"))) {
           mod.put("maturityStyle", "none");
         } else {
           mod.put("maturityStyle", "yes");
@@ -2178,7 +2178,7 @@
         // Save enforcement
         String warnMsg = "";
         for (Enumeration<String> e = request.getParameterNames(); e.hasMoreElements();) {
-          String parameter = (String) e.nextElement();
+          String parameter = e.nextElement();
           if (parameter.startsWith("inpEnforcement")) {
             String depId = parameter.replace("inpEnforcement", "");
             String value = vars.getStringParameter(parameter);
--- a/src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData.java	Sat May 30 19:57:13 2015 +0200
@@ -222,9 +222,9 @@
             // Not installed previously
             String strXml = Utility.fileToString(datasetFile.getPath());
             ImportResult myResult = myData.importDataFromXML(
-                (Client) OBDal.getInstance().get(Client.class, vars.getClient()),
-                (Organization) OBDal.getInstance().get(Organization.class, strOrganization),
-                strXml, (Module) OBDal.getInstance().get(Module.class, data[j].adModuleId), true);
+                OBDal.getInstance().get(Client.class, vars.getClient()),
+                OBDal.getInstance().get(Organization.class, strOrganization), strXml, OBDal
+                    .getInstance().get(Module.class, data[j].adModuleId), true);
             m_info.append(SALTO_LINEA).append("File: ").append(datasetFile.getName()).append(":")
                 .append(SALTO_LINEA);
             if (myResult.getLogMessages() != null && !myResult.getLogMessages().equals("")
--- a/src/org/openbravo/erpCommon/ad_process/MRPPurchaseCreateReservations.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/MRPPurchaseCreateReservations.java	Sat May 30 19:57:13 2015 +0200
@@ -97,7 +97,7 @@
     try {
       while (outgoingRLs.next()) {
         PurchasingRunLine outgoingLine = (PurchasingRunLine) outgoingRLs.get(0);
-        if (!productID.equals((String) DalUtil.getId(outgoingLine.getProduct()))) {
+        if (!productID.equals(DalUtil.getId(outgoingLine.getProduct()))) {
           productID = (String) DalUtil.getId(outgoingLine.getProduct());
           currentStock = BigDecimal.ZERO;
         }
@@ -107,8 +107,7 @@
         while (quantity.signum() == 1) {
           if (currentStock.signum() < 1 && incomingRLs.next()) {
             incomingLine = (PurchasingRunLine) incomingRLs.get(0);
-            if (!productID.equals((String) DalUtil.getId(outgoingLine.getProduct()))
-                && incomingRLs.next()) {
+            if (!productID.equals(DalUtil.getId(outgoingLine.getProduct())) && incomingRLs.next()) {
               incomingLine = (PurchasingRunLine) incomingRLs.get(0);
             }
             currentStock = currentStock.add(incomingLine.getQuantity());
--- a/src/org/openbravo/erpCommon/ad_process/RegisterModule.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/RegisterModule.java	Sat May 30 19:57:13 2015 +0200
@@ -80,7 +80,7 @@
         if (!error) {
           // retrieve the module details from the webservice
           WebService3ImplServiceLocator loc = new WebService3ImplServiceLocator();
-          ws = (WebService3Impl) loc.getWebService3();
+          ws = loc.getWebService3();
         }
       } catch (Exception e) {
         error = true;
--- a/src/org/openbravo/erpCommon/businessUtility/InitialClientSetup.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/businessUtility/InitialClientSetup.java	Sat May 30 19:57:13 2015 +0200
@@ -304,7 +304,7 @@
             log4j.debug("insertTrees() - Saved menu tree.");
           }
         } else {
-          String tableTreeName = (String) tableTree.getName();
+          String tableTreeName = tableTree.getName();
           String treeTypeName = null;
           if (tableTree.getTable().getTreeType() != null) {
             treeTypeName = tableTree.getTable().getTreeType();
--- a/src/org/openbravo/erpCommon/info/ImageInfoBLOB.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/info/ImageInfoBLOB.java	Sat May 30 19:57:13 2015 +0200
@@ -248,8 +248,7 @@
           Table table = OBDal.getInstance().get(Table.class, tableId);
           Entity entity = ModelProvider.getInstance().getEntityByTableName(table.getDBTableName());
           String propertyName = entity.getPropertyByColumnName(columnName).getName();
-          BaseOBObject parentObject = (BaseOBObject) OBDal.getInstance().get(entity.getName(),
-              parentObjectId);
+          BaseOBObject parentObject = OBDal.getInstance().get(entity.getName(), parentObjectId);
           parentObject.set(propertyName, null);
           OBDal.getInstance().flush();
           OBDal.getInstance().remove(image);
--- a/src/org/openbravo/erpCommon/modules/ImportModule.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/modules/ImportModule.java	Sat May 30 19:57:13 2015 +0200
@@ -1701,7 +1701,7 @@
           HashMap<String, String> additionalInfo = updates[i].getAdditionalInfo();
           if (additionalInfo != null && additionalInfo.containsKey("upgrade")) {
             log4j.info("Upgrade found:" + additionalInfo.get("upgrade"));
-            JSONObject upgrade = new JSONObject((String) additionalInfo.get("upgrade"));
+            JSONObject upgrade = new JSONObject(additionalInfo.get("upgrade"));
             final String moduleId = upgrade.getString("moduleId");
             org.openbravo.model.ad.module.Module module = OBDal.getInstance().get(
                 org.openbravo.model.ad.module.Module.class, moduleId);
--- a/src/org/openbravo/erpCommon/modules/VersionUtility.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/modules/VersionUtility.java	Sat May 30 19:57:13 2015 +0200
@@ -666,7 +666,7 @@
       String[] moduleVersionToUpdateId, OBError obErrors, HashMap<String, String> maturityLevels)
       throws Exception {
     WebService3ImplServiceLocator loc = new WebService3ImplServiceLocator();
-    WebService3Impl ws = (WebService3Impl) loc.getWebService3();
+    WebService3Impl ws = loc.getWebService3();
     String[] errors = new String[0];
 
     ModuleInstallDetail mid = ws.checkConsistency(ImportModule.getInstalledModulesAndDeps(),
--- a/src/org/openbravo/erpCommon/utility/GenericTree.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/utility/GenericTree.java	Sat May 30 19:57:13 2015 +0200
@@ -226,11 +226,11 @@
     for (int i = 0; i < data.length; i++) {
       // endline: set the spotted right line with angles
       if (!isSubTree && i == 0) {
-        FieldProviderFactory.setField((FieldProvider) data[i], "endline", "Tree_FirstNode_Spots");
+        FieldProviderFactory.setField(data[i], "endline", "Tree_FirstNode_Spots");
       } else if (i == (data.length - 1)) {
-        FieldProviderFactory.setField((FieldProvider) data[i], "endline", "Tree_LastNode_Spots");
+        FieldProviderFactory.setField(data[i], "endline", "Tree_LastNode_Spots");
       } else {
-        FieldProviderFactory.setField((FieldProvider) data[i], "endline", "Tree_MiddleNode_Spots");
+        FieldProviderFactory.setField(data[i], "endline", "Tree_MiddleNode_Spots");
       }
 
       // Level tree: sets the spotted left lines
--- a/src/org/openbravo/erpCommon/utility/Utility.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/utility/Utility.java	Sat May 30 19:57:13 2015 +0200
@@ -2374,9 +2374,9 @@
       float oldRatio = (float) oldW / (float) oldH;
       float newRatio = (float) newW / (float) newH;
       if (oldRatio < newRatio) {
-        newW = (int) ((float) newH * oldRatio);
+        newW = (int) (newH * oldRatio);
       } else if (oldRatio > newRatio) {
-        newH = (int) ((float) newW / oldRatio);
+        newH = (int) (newW / oldRatio);
       }
     }
     BufferedImage dimg = new BufferedImage(newW, newH, rImage.getType());
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java	Sat May 30 19:57:13 2015 +0200
@@ -773,7 +773,7 @@
     attachments.add(new File(attachmentFileLocation));
 
     if (object != null) {
-      final Vector<Object> vector = (Vector<Object>) object;
+      final Vector<Object> vector = object;
       for (int i = 0; i < vector.size(); i++) {
         final AttachContent objContent = (AttachContent) vector.get(i);
         final File file = prepareFile(objContent, ourReference);
--- a/src/org/openbravo/erpReports/ReportVatRegisterJR.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/erpReports/ReportVatRegisterJR.java	Sat May 30 19:57:13 2015 +0200
@@ -179,7 +179,7 @@
     JasperPrint jr1 = new JasperPrint();
     String scl = "";
     for (Iterator<Object> iterator = coll.iterator(); iterator.hasNext();) {
-      object = (Object) iterator.next();
+      object = iterator.next();
       scl = object.getClass().toString();
       if (scl.contains("JasperPrint")) {
         jr1 = (JasperPrint) object;
--- a/src/org/openbravo/materialmgmt/InventoryCountProcess.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/materialmgmt/InventoryCountProcess.java	Sat May 30 19:57:13 2015 +0200
@@ -104,7 +104,7 @@
       msg.setType("Error");
       msg.setTitle(OBMessageUtils.messageBD(bundle.getConnection(), "Error", bundle.getContext()
           .getLanguage()));
-      msg.setMessage(((GenericJDBCException) ge).getSQLException().getMessage());
+      msg.setMessage(ge.getSQLException().getMessage());
       bundle.setResult(msg);
       OBDal.getInstance().rollbackAndClose();
       final String recordID = (String) bundle.getParams().get("M_Inventory_ID");
@@ -117,7 +117,7 @@
       msg.setType("Error");
       msg.setTitle(OBMessageUtils.messageBD(bundle.getConnection(), "Error", bundle.getContext()
           .getLanguage()));
-      msg.setMessage(((QueryTimeoutException) qte).getSQLException().getMessage().split("\n")[0]);
+      msg.setMessage(qte.getSQLException().getMessage().split("\n")[0]);
       bundle.setResult(msg);
       OBDal.getInstance().rollbackAndClose();
       final String recordID = (String) bundle.getParams().get("M_Inventory_ID");
--- a/src/org/openbravo/materialmgmt/VariantAutomaticGenerationProcess.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/materialmgmt/VariantAutomaticGenerationProcess.java	Sat May 30 19:57:13 2015 +0200
@@ -132,8 +132,8 @@
       int productNo = 0;
       int k = 0;
       Long start = System.currentTimeMillis();
-      boolean multilingualDocs = ((Client) OBDal.getInstance().get(Client.class,
-          bundle.getContext().getClient())).isMultilingualDocuments();
+      boolean multilingualDocs = OBDal.getInstance()
+          .get(Client.class, bundle.getContext().getClient()).isMultilingualDocuments();
       do {
         k = k + 1;
         // Create variant product
@@ -242,7 +242,7 @@
       msg.setType("Error");
       msg.setTitle(OBMessageUtils.messageBD(bundle.getConnection(), "Error", bundle.getContext()
           .getLanguage()));
-      msg.setMessage(((GenericJDBCException) ge).getSQLException().getMessage());
+      msg.setMessage(ge.getSQLException().getMessage());
       bundle.setResult(msg);
       OBDal.getInstance().rollbackAndClose();
       // Oracle wraps the exception into a QueryTimeoutException
@@ -251,7 +251,7 @@
       msg.setType("Error");
       msg.setTitle(OBMessageUtils.messageBD(bundle.getConnection(), "Error", bundle.getContext()
           .getLanguage()));
-      msg.setMessage(((QueryTimeoutException) qte).getSQLException().getMessage().split("\n")[0]);
+      msg.setMessage(qte.getSQLException().getMessage().split("\n")[0]);
       bundle.setResult(msg);
       OBDal.getInstance().rollbackAndClose();
     } catch (final Exception e) {
--- a/src/org/openbravo/materialmgmt/VariantChDescUpdateProcess.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/materialmgmt/VariantChDescUpdateProcess.java	Sat May 30 19:57:13 2015 +0200
@@ -61,7 +61,7 @@
       msg.setType("Error");
       msg.setTitle(OBMessageUtils.messageBD(bundle.getConnection(), "Error", bundle.getContext()
           .getLanguage()));
-      msg.setMessage(((GenericJDBCException) ge).getSQLException().getMessage());
+      msg.setMessage(ge.getSQLException().getMessage());
       bundle.setResult(msg);
       OBDal.getInstance().rollbackAndClose();
       // Oracle wraps the exception into a QueryTimeoutException
@@ -70,7 +70,7 @@
       msg.setType("Error");
       msg.setTitle(OBMessageUtils.messageBD(bundle.getConnection(), "Error", bundle.getContext()
           .getLanguage()));
-      msg.setMessage(((QueryTimeoutException) qte).getSQLException().getMessage().split("\n")[0]);
+      msg.setMessage(qte.getSQLException().getMessage().split("\n")[0]);
       bundle.setResult(msg);
       OBDal.getInstance().rollbackAndClose();
     } catch (final Exception e) {
--- a/src/org/openbravo/service/db/CallProcess.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/service/db/CallProcess.java	Sat May 30 19:57:13 2015 +0200
@@ -114,7 +114,7 @@
    */
   public ProcessInstance call(org.openbravo.model.ad.ui.Process process, String recordID,
       Map<String, String> parameters, Boolean doCommit) {
-    return callProcess(process, recordID, (Map<String, ?>) parameters, doCommit);
+    return callProcess(process, recordID, parameters, doCommit);
   }
 
   /**
--- a/src/org/openbravo/service/db/DataImportService.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/service/db/DataImportService.java	Sat May 30 19:57:13 2015 +0200
@@ -333,8 +333,7 @@
           final Entity entity = PrimitiveReferenceHandler.getInstance()
               .getPrimitiveReferencedEntity(objectToRepair, p);
 
-          final BaseOBObject referencedBob = (BaseOBObject) entityResolver.resolve(
-              entity.getName(), value, true);
+          final BaseOBObject referencedBob = entityResolver.resolve(entity.getName(), value, true);
 
           if (referencedBob == null || referencedBob.getId() == null) {
             if (ir.getErrorMessages() == null) {
--- a/src/org/openbravo/service/importprocess/ImportProcessUtils.java	Fri May 29 09:52:37 2015 +0200
+++ b/src/org/openbravo/service/importprocess/ImportProcessUtils.java	Sat May 30 19:57:13 2015 +0200
@@ -85,7 +85,7 @@
       } else if (jsonData instanceof JSONArray) {
         final JSONArray jsonArray = (JSONArray) jsonData;
         if (jsonArray.length() > 0) {
-          jsonContent = (JSONObject) jsonArray.getJSONObject(0);
+          jsonContent = jsonArray.getJSONObject(0);
         }
       }
       if (jsonContent != null && jsonContent.has(property)) {