# HG changeset patch
# User Alejandro <alekosmp86@gmail.com>
# Date 1569270577 14400
#      Mon Sep 23 16:29:37 2019 -0400
# Node ID 7a20fe2726bded1acab156651c79c2ef50615889
# Parent  0a939c6d924fb574a81e3b5984fe26be4d80702b
Related to issue 41890: Replaced StringBuffer/Builder with String.

diff --git a/src/org/openbravo/mobile/core/eventobservers/UIConfigurationActionsPositionEventObserver.java b/src/org/openbravo/mobile/core/eventobservers/UIConfigurationActionsPositionEventObserver.java
--- a/src/org/openbravo/mobile/core/eventobservers/UIConfigurationActionsPositionEventObserver.java
+++ b/src/org/openbravo/mobile/core/eventobservers/UIConfigurationActionsPositionEventObserver.java
@@ -205,16 +205,14 @@
   private List<MobileUiConfigurationWindowAbaAction> getCurrentConfiguredActionsInABA(
       EntityPersistenceEvent event, MobileUiConfigurationWindowAbaAction targetActionInABA) {
 
-    final StringBuilder whereClause = new StringBuilder();
-    whereClause.append(" as act_in_aba ");
-    whereClause.append(" where act_in_aba.aBAUiConfiguration.id = :curABAId ");
+    String whereClause = " as act_in_aba where act_in_aba.aBAUiConfiguration.id = :curABAId ";
 
     if (event instanceof EntityUpdateEvent) {
-      whereClause.append(" and act_in_aba.id <> :curActionId");
+      whereClause += " and act_in_aba.id <> :curActionId";
     }
 
     OBQuery<MobileUiConfigurationWindowAbaAction> query = OBDal.getInstance()
-        .createQuery(MobileUiConfigurationWindowAbaAction.class, whereClause.toString());
+        .createQuery(MobileUiConfigurationWindowAbaAction.class, whereClause);
     if (event instanceof EntityUpdateEvent) {
       query.setNamedParameter("curActionId", targetActionInABA.getId());
     }
diff --git a/src/org/openbravo/mobile/core/login/ProfileUtils.java b/src/org/openbravo/mobile/core/login/ProfileUtils.java
--- a/src/org/openbravo/mobile/core/login/ProfileUtils.java
+++ b/src/org/openbravo/mobile/core/login/ProfileUtils.java
@@ -121,11 +121,7 @@
     for (Organization org : orgs) {
       JSONObject orgWarehouse = new JSONObject();
       orgWarehouse.put("orgId", org.getId());
-      StringBuffer hqlQuery = new StringBuffer();
-      hqlQuery.append("organization.id in (:orgList) AND ");
-      hqlQuery.append("client.id=:clientId AND ");
-      hqlQuery.append("organization.active=true ");
-      hqlQuery.append("order by name");
+      final String hqlQuery = "organization.id in (:orgList) AND client.id=:clientId AND organization.active=true order by name";
       final OBQuery<Warehouse> warehouses = OBDal.getInstance()
           .createQuery(Warehouse.class, hqlQuery.toString());
       warehouses.setNamedParameter("orgList", osp.getNaturalTree(org.getId()));
@@ -174,10 +170,10 @@
     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());
       if (extraField != null) {
-        jsonArrayItem.put(extraField, (String) bob.getValue(extraFieldProperty));
+        jsonArrayItem.put(extraField, bob.getValue(extraFieldProperty));
       }
       jsonArray.put(jsonArrayItem);
     }
