[ofbiz-framework] branch trunk updated (c52e437 -> 443025e)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated (c52e437 -> 443025e)

surajk
This is an automated email from the ASF dual-hosted git repository.

surajk pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git.


    from c52e437  Improved: Removes trailing blanks found by chance, updates checkstyleMain.maxErrors
     new fc6b8a6  Improved: Corrected remaining ', is not followed by whitespace' checkstyle errors in framework component. (OFBIZ-11805)
     new 443025e  Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-framework into trunk

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/ofbiz/base/util/UtilMisc.java  |  2 +-
 .../container/CrossSubdomainSessionValve.java      |  2 +-
 .../java/org/apache/ofbiz/common/FindServices.java |  4 +-
 .../apache/ofbiz/common/image/ImageTransform.java  |  2 +-
 .../apache/ofbiz/common/login/LoginServices.java   | 82 +++++++++++-----------
 .../org/apache/ofbiz/entity/model/ModelEntity.java |  2 +-
 .../ofbiz/entity/model/ModelEntityChecker.java     |  2 +-
 .../org/apache/ofbiz/entity/model/ModelReader.java |  2 +-
 .../apache/ofbiz/entity/model/ModelViewEntity.java |  2 +-
 .../org/apache/ofbiz/entity/util/EntityUtil.java   |  6 +-
 .../java/org/apache/ofbiz/security/Security.java   |  2 +-
 .../ofbiz/webapp/control/RequestHandler.java       |  2 +-
 .../webtools/artifactinfo/ServiceArtifactInfo.java |  4 +-
 13 files changed, 56 insertions(+), 58 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] 01/02: Improved: Corrected remaining ', is not followed by whitespace' checkstyle errors in framework component. (OFBIZ-11805)

surajk
This is an automated email from the ASF dual-hosted git repository.

surajk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git

commit fc6b8a6ca301c074dedffd45543e68aeb437065a
Author: Suraj Khurana <[hidden email]>
AuthorDate: Tue Jul 7 15:08:17 2020 +0530

    Improved: Corrected remaining ', is not followed by whitespace' checkstyle errors in framework component.
    (OFBIZ-11805)
---
 .../java/org/apache/ofbiz/base/util/UtilMisc.java  |  2 +-
 .../container/CrossSubdomainSessionValve.java      |  2 +-
 .../java/org/apache/ofbiz/common/FindServices.java |  4 +-
 .../apache/ofbiz/common/image/ImageTransform.java  |  2 +-
 .../apache/ofbiz/common/login/LoginServices.java   | 82 +++++++++++-----------
 .../org/apache/ofbiz/entity/model/ModelEntity.java |  2 +-
 .../ofbiz/entity/model/ModelEntityChecker.java     |  2 +-
 .../org/apache/ofbiz/entity/model/ModelReader.java |  2 +-
 .../apache/ofbiz/entity/model/ModelViewEntity.java |  2 +-
 .../org/apache/ofbiz/entity/util/EntityUtil.java   |  6 +-
 .../java/org/apache/ofbiz/security/Security.java   |  2 +-
 .../ofbiz/webapp/control/RequestHandler.java       |  2 +-
 .../webtools/artifactinfo/ServiceArtifactInfo.java |  4 +-
 13 files changed, 56 insertions(+), 58 deletions(-)

diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java
index 3588be4..f0934c3 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilMisc.java
@@ -605,7 +605,7 @@ public final class UtilMisc {
     }
 
     /** List of domains or IP addresses to be checked to prevent Host Header Injection,
-     * no spaces after commas,no wildcard, can be extended of course...
+     * no spaces after commas, no wildcard, can be extended of course...
      * @return List of domains or IP addresses to be checked to prevent Host Header Injection,
      */
     public static List<String> getHostHeadersAllowed() {
diff --git a/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CrossSubdomainSessionValve.java b/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CrossSubdomainSessionValve.java
index cc30aac..8afde01 100644
--- a/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CrossSubdomainSessionValve.java
+++ b/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CrossSubdomainSessionValve.java
@@ -116,7 +116,7 @@ public class CrossSubdomainSessionValve extends ValveBase {
                     MessageBytes value = mimeHeaders.getValue(i);
                     if (value.indexOf(cookie.getName()) >= 0) {
                         String newCookieValue = request.getContext().
-                                getCookieProcessor().generateHeader(newCookie,request);
+                                getCookieProcessor().generateHeader(newCookie, request);
                         if (Debug.verboseOn())
                             Debug.logVerbose("CrossSubdomainSessionValve: old Set-Cookie value: " + value.toString(),
                                     MODULE);
diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java
index 8efc0bf..5da39db 100644
--- a/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java
+++ b/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java
@@ -487,7 +487,7 @@ public class FindServices {
         }
 
         result.put("listSize", listSize);
-        result.put("list",list);
+        result.put("list", list);
         result.remove("listIt");
         return result;
     }
@@ -809,7 +809,7 @@ public class FindServices {
         }
 
         if (UtilValidate.isNotEmpty(item)) {
-            result.put("item",item);
+            result.put("item", item);
         }
         result.remove("listIt");
 
diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/image/ImageTransform.java b/framework/common/src/main/java/org/apache/ofbiz/common/image/ImageTransform.java
index 5b0ba4c..fdbd693 100644
--- a/framework/common/src/main/java/org/apache/ofbiz/common/image/ImageTransform.java
+++ b/framework/common/src/main/java/org/apache/ofbiz/common/image/ImageTransform.java
@@ -296,7 +296,7 @@ public class ImageTransform {
                     bufImgType);
 
         Graphics2D g = bufferedImage.createGraphics();
-        g.drawImage(image,0,0,null);
+        g.drawImage(image, 0, 0, null);
         g.dispose();
 
         return( bufferedImage );
diff --git a/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java b/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java
index 089e826..e38ddba 100644
--- a/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java
+++ b/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java
@@ -74,6 +74,7 @@ public class LoginServices {
     /** Login service to authenticate username and password
      * @return Map of results including (userLogin) GenericValue object
      */
+    @SuppressWarnings("checkstyle:LineLength")
     public static Map<String, Object> userLogin(DispatchContext ctx, Map<String, ?> context) {
         LocalDispatcher dispatcher = ctx.getDispatcher();
         Locale locale = (Locale) context.get("locale");
@@ -190,8 +191,8 @@ public class LoginServices {
                     userLogin = GenericValue.create(userLogin);
 
                     // get the is system flag -- system accounts can only be used for service authentication
-                    boolean isSystem = (isServiceAuth && userLogin.get("isSystem") != null) ?
-                            "Y".equalsIgnoreCase(userLogin.getString("isSystem")) : false;
+                    boolean isSystem = (isServiceAuth && userLogin.get("isSystem") != null)
+                            ? "Y".equalsIgnoreCase(userLogin.getString("isSystem")) : false;
 
                     // grab the hasLoggedOut flag
                     Boolean hasLoggedOut = userLogin.getBoolean("hasLoggedOut");
@@ -397,19 +398,19 @@ public class LoginServices {
                         }
 
                         Map<String, Object> messageMap = UtilMisc.<String, Object>toMap("username", username);
-                        errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.account_for_user_login_id_disabled",messageMap ,locale);
+                        errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.account_for_user_login_id_disabled", messageMap , locale);
                         if (disabledDateTime != null) {
                             messageMap = UtilMisc.<String, Object>toMap("disabledDateTime", disabledDateTime);
-                            errMsg += " " + UtilProperties.getMessage(RESOURCE,"loginservices.since_datetime",messageMap ,locale);
+                            errMsg += " " + UtilProperties.getMessage(RESOURCE, "loginservices.since_datetime", messageMap , locale);
                         } else {
                             errMsg += ".";
                         }
 
                         if (loginDisableMinutes > 0 && reEnableTime != null) {
                             messageMap = UtilMisc.<String, Object>toMap("reEnableTime", reEnableTime);
-                            errMsg += " " + UtilProperties.getMessage(RESOURCE,"loginservices.will_be_reenabled",messageMap ,locale);
+                            errMsg += " " + UtilProperties.getMessage(RESOURCE, "loginservices.will_be_reenabled", messageMap , locale);
                         } else {
-                            errMsg += " " + UtilProperties.getMessage(RESOURCE,"loginservices.not_scheduled_to_be_reenabled",locale);
+                            errMsg += " " + UtilProperties.getMessage(RESOURCE, "loginservices.not_scheduled_to_be_reenabled", locale);
                         }
                     }
                 } else {
@@ -598,7 +599,7 @@ public class LoginServices {
                 // check if we have hit the limit on number of password changes to be saved. If we did then delete the oldest password from history.
                 eli.last();
                 int rowIndex = eli.currentIndex();
-                if (rowIndex==passwordChangeHistoryLimit) {
+                if (rowIndex == passwordChangeHistoryLimit) {
                     eli.afterLast();
                     pwdHist = eli.previous();
                     pwdHist.remove();
@@ -654,12 +655,12 @@ public class LoginServices {
                     if (!partyId.equals(loggedInUserLogin.getString("partyId"))) {
                         if (!security.hasEntityPermission("PARTYMGR", "_CREATE", loggedInUserLogin)) {
 
-                            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.party_with_specified_party_ID_exists_not_have_permission", locale);
+                            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.party_with_specified_party_ID_exists_not_have_permission", locale);
                             errorMessageList.add(errMsg);
                         }
                     }
                 } else {
-                    errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.must_be_logged_in_and_permission_create_login_party_ID_exists", locale);
+                    errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.must_be_logged_in_and_permission_create_login_party_ID_exists", locale);
                     errorMessageList.add(errMsg);
                 }
             }
@@ -683,13 +684,13 @@ public class LoginServices {
             EntityCondition condition = EntityCondition.makeCondition(EntityFunction.UPPER_FIELD("userLoginId"), EntityOperator.EQUALS, EntityFunction.UPPER(userLoginId));
             if (UtilValidate.isNotEmpty(EntityQuery.use(delegator).from("UserLogin").where(condition).queryList())) {
                 Map<String, String> messageMap = UtilMisc.toMap("userLoginId", userLoginId);
-                errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_create_login_user_with_ID_exists", messageMap, locale);
+                errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_create_login_user_with_ID_exists", messageMap, locale);
                 errorMessageList.add(errMsg);
             }
         } catch (GenericEntityException e) {
             Debug.logWarning(e, "", MODULE);
             Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage());
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_create_login_user_read_failure", messageMap, locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_create_login_user_read_failure", messageMap, locale);
             errorMessageList.add(errMsg);
         }
 
@@ -703,10 +704,9 @@ public class LoginServices {
         } catch (GenericEntityException e) {
             Debug.logWarning(e, "", MODULE);
             Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage());
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_create_login_user_write_failure", messageMap, locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_create_login_user_write_failure", messageMap, locale);
             return ServiceUtil.returnError(errMsg);
         }
-
         result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
         return result;
     }
@@ -744,7 +744,7 @@ public class LoginServices {
             userLoginToUpdate = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", userLoginId).queryOne();
         } catch (GenericEntityException e) {
             Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage());
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_change_password_read_failure", messageMap, locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_change_password_read_failure", messageMap, locale);
             return ServiceUtil.returnError(errMsg);
         }
 
@@ -753,7 +753,7 @@ public class LoginServices {
         // TODO: change this security group because we can't use permission groups defined in the applications from the framework.
         if (!security.hasEntityPermission("PARTYMGR", "_UPDATE", loggedInUserLogin)) {
             if (!userLoginId.equals(loggedInUserLogin.getString("userLoginId"))) {
-                errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.not_have_permission_update_password_for_user_login", locale);
+                errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.not_have_permission_update_password_for_user_login", locale);
                 return ServiceUtil.returnError(errMsg);
             }
             if (UtilValidate.isNotEmpty(context.get("login.token"))) {
@@ -785,7 +785,7 @@ public class LoginServices {
                 } catch (AuthenticatorException e) {
                     Debug.logError(e, e.getMessage(), MODULE);
                     Map<String, String> messageMap = UtilMisc.toMap("userLoginId", userLoginId);
-                    errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_change_password_userlogin_with_id_not_exist", messageMap, locale);
+                    errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_change_password_userlogin_with_id_not_exist", messageMap, locale);
                     return ServiceUtil.returnError(errMsg);
                 }
                 //result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
@@ -793,7 +793,7 @@ public class LoginServices {
                 return result;
             }
             Map<String, String> messageMap = UtilMisc.toMap("userLoginId", userLoginId);
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_change_password_userlogin_with_id_not_exist", messageMap, locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_change_password_userlogin_with_id_not_exist", messageMap, locale);
             return ServiceUtil.returnError(errMsg);
         }
 
@@ -821,7 +821,7 @@ public class LoginServices {
             } catch (AuthenticatorException e) {
                 Debug.logError(e, e.getMessage(), MODULE);
                 Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage());
-                errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_change_password_write_failure", messageMap, locale);
+                errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_change_password_write_failure", messageMap, locale);
                 return ServiceUtil.returnError(errMsg);
             }
         } else {
@@ -835,7 +835,7 @@ public class LoginServices {
                 createUserLoginPasswordHistory(userLoginToUpdate);
             } catch (GenericEntityException e) {
                 Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage());
-                errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_change_password_write_failure", messageMap, locale);
+                errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_change_password_write_failure", messageMap, locale);
                 return ServiceUtil.returnError(errMsg);
             }
         }
@@ -874,11 +874,11 @@ public class LoginServices {
             if (!loggedInUserLogin.isEmpty()) {
                 // security check: userLogin partyId must equal partyId, or must have PARTYMGR_CREATE permission
                 if (!partyId.equals(loggedInUserLogin.getString("partyId"))) {
-                    errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.party_with_party_id_exists_not_permission_create_user_login", locale);
+                    errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.party_with_party_id_exists_not_permission_create_user_login", locale);
                     errorMessageList.add(errMsg);
                 }
             } else {
-                errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.must_logged_in_have_permission_create_user_login_exists", locale);
+                errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.must_logged_in_have_permission_create_user_login_exists", locale);
                 errorMessageList.add(errMsg);
             }
         }
@@ -892,14 +892,14 @@ public class LoginServices {
         } catch (GenericEntityException e) {
             Debug.logWarning(e, "", MODULE);
             Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage());
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_create_login_user_read_failure", messageMap, locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_create_login_user_read_failure", messageMap, locale);
             errorMessageList.add(errMsg);
         }
 
         if (newUserLogin != null) {
             if (!newUserLogin.get("partyId").equals(partyId)) {
                 Map<String, String> messageMap = UtilMisc.toMap("userLoginId", userLoginId);
-                errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_create_login_user_with_ID_exists", messageMap, locale);
+                errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_create_login_user_with_ID_exists", messageMap, locale);
                 errorMessageList.add(errMsg);
             } else {
                 doCreate = false;
@@ -927,7 +927,7 @@ public class LoginServices {
         } catch (GenericEntityException e) {
             Debug.logWarning(e, "", MODULE);
             Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage());
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_create_login_user_write_failure", messageMap, locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_create_login_user_write_failure", messageMap, locale);
             return ServiceUtil.returnError(errMsg);
         }
 
@@ -940,7 +940,7 @@ public class LoginServices {
         } catch (GenericEntityException e) {
             Debug.logWarning(e, "", MODULE);
             Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage());
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_disable_old_login_user_write_failure", messageMap, locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_disable_old_login_user_write_failure", messageMap, locale);
             return ServiceUtil.returnError(errMsg);
         }
 
@@ -970,7 +970,7 @@ public class LoginServices {
 
         // <b>security check</b>: must have PARTYMGR_UPDATE permission
         if (!security.hasEntityPermission("PARTYMGR", "_UPDATE", loggedInUserLogin) && !security.hasEntityPermission("SECURITY", "_UPDATE", loggedInUserLogin)) {
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.not_permission_update_security_info_for_user_login", locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.not_permission_update_security_info_for_user_login", locale);
             return ServiceUtil.returnError(errMsg);
         }
 
@@ -980,13 +980,13 @@ public class LoginServices {
             userLoginToUpdate = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", userLoginId).queryOne();
         } catch (GenericEntityException e) {
             Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage());
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_change_password_read_failure", messageMap, locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_change_password_read_failure", messageMap, locale);
             return ServiceUtil.returnError(errMsg);
         }
 
         if (userLoginToUpdate == null) {
             Map<String, String> messageMap = UtilMisc.toMap("userLoginId", userLoginId);
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_change_password_userlogin_with_id_not_exist", messageMap, locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_change_password_userlogin_with_id_not_exist", messageMap, locale);
             return ServiceUtil.returnError(errMsg);
         }
 
@@ -1025,7 +1025,7 @@ public class LoginServices {
             userLoginToUpdate.store();
         } catch (GenericEntityException e) {
             Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage());
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.could_not_change_password_write_failure", messageMap, locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.could_not_change_password_write_failure", messageMap, locale);
             return ServiceUtil.returnError(errMsg);
         }
 
@@ -1044,21 +1044,21 @@ public class LoginServices {
             // if this is a system account don't bother checking the passwords
             boolean passwordMatches = checkPassword(userLogin.getString("currentPassword"), useEncryption, currentPassword);
             if ((currentPassword == null) || (!passwordMatches)) {
-                errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.old_password_not_correct_reenter", locale);
+                errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.old_password_not_correct_reenter", locale);
                 errorMessageList.add(errMsg);
             }
             if (checkPassword(userLogin.getString("currentPassword"), useEncryption, newPassword)) {
-                errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.new_password_is_equal_to_old_password", locale);
+                errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.new_password_is_equal_to_old_password", locale);
                 errorMessageList.add(errMsg);
             }
 
         }
 
         if (UtilValidate.isEmpty(newPassword) || UtilValidate.isEmpty(newPasswordVerify)) {
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.password_or_verify_missing", locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.password_or_verify_missing", locale);
             errorMessageList.add(errMsg);
         } else if (!newPassword.equals(newPasswordVerify)) {
-            errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.password_did_not_match_verify_password", locale);
+            errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.password_did_not_match_verify_password", locale);
             errorMessageList.add(errMsg);
         }
 
@@ -1075,13 +1075,13 @@ public class LoginServices {
             try {
                 List<GenericValue> pwdHistList = EntityQuery.use(delegator)
                                                             .from("UserLoginPasswordHistory")
-                                                            .where("userLoginId",userLogin.getString("userLoginId"))
+                                                            .where("userLoginId", userLogin.getString("userLoginId"))
                                                             .orderBy("-fromDate")
                                                             .queryList();
                 for (GenericValue pwdHistValue : pwdHistList) {
                     if (checkPassword(pwdHistValue.getString("currentPassword"), useEncryption, newPassword)) {
                         Map<String, Integer> messageMap = UtilMisc.toMap("passwordChangeHistoryLimit", passwordChangeHistoryLimit);
-                        errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.password_must_be_different_from_last_passwords", messageMap, locale);
+                        errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.password_must_be_different_from_last_passwords", messageMap, locale);
                         errorMessageList.add(errMsg);
                         break;
                     }
@@ -1089,11 +1089,9 @@ public class LoginServices {
             } catch (GenericEntityException e) {
                 Debug.logWarning(e, "", MODULE);
                 Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage());
-                errMsg = UtilProperties.getMessage(RESOURCE,"loginevents.error_accessing_password_change_history", messageMap, locale);
+                errMsg = UtilProperties.getMessage(RESOURCE, "loginevents.error_accessing_password_change_history", messageMap, locale);
             }
-
         }
-
         int minPasswordLength = 0;
 
         try {
@@ -1121,16 +1119,16 @@ public class LoginServices {
             } else {
                 if (!(newPassword.length() >= minPasswordLength)) {
                     Map<String, String> messageMap = UtilMisc.toMap("minPasswordLength", Integer.toString(minPasswordLength));
-                    errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.password_must_be_least_characters_long", messageMap, locale);
+                    errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.password_must_be_least_characters_long", messageMap, locale);
                     errorMessageList.add(errMsg);
                 }
             }
             if (newPassword.equalsIgnoreCase(userLogin.getString("userLoginId"))) {
-                errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.password_may_not_equal_username", locale);
+                errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.password_may_not_equal_username", locale);
                 errorMessageList.add(errMsg);
             }
             if (UtilValidate.isNotEmpty(passwordHint) && (passwordHint.toUpperCase(Locale.getDefault()).indexOf(newPassword.toUpperCase(Locale.getDefault())) >= 0)) {
-                errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.password_hint_may_not_contain_password", locale);
+                errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.password_hint_may_not_contain_password", locale);
                 errorMessageList.add(errMsg);
             }
         }
@@ -1168,7 +1166,7 @@ public class LoginServices {
         } catch (ServletException e) {
 
             StringManager sm = StringManager.getManager("org.apache.catalina.connector");
-            if (sm.getString("coyoteRequest.alreadyAuthenticated").equals(e.getMessage())){
+            if (sm.getString("coyoteRequest.alreadyAuthenticated").equals(e.getMessage())) {
                 return true;
             } else {
                 Debug.logError(e, MODULE);
diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelEntity.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelEntity.java
index e707589..4e6db54 100644
--- a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelEntity.java
+++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelEntity.java
@@ -1612,7 +1612,7 @@ public class ModelEntity implements Comparable<ModelEntity>, Serializable {
                 attributeMap.put("externalType", sqlType.substring(0, sqlType.indexOf('(')));
                 // since there is a field length set that
                 String widthStr = sqlType.substring(sqlType.indexOf('(') + 1, sqlType.indexOf(')'));
-                // if there is a comma split by it for width,precision
+                // if there is a comma split by it for width, precision
                 if (widthStr.indexOf(',') >= 0) {
                     attributeMap.put("width", widthStr.substring(0, widthStr.indexOf(',')));
                     // since there is a field precision set that
diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelEntityChecker.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelEntityChecker.java
index 55de827..701a189 100644
--- a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelEntityChecker.java
+++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelEntityChecker.java
@@ -109,7 +109,7 @@ public class ModelEntityChecker {
                 Iterator<ModelField> fieldIter = entity.getFieldsIterator();
                 while (fieldIter.hasNext()) {
                     ModelField field = fieldIter.next();
-                    ModelFieldType type = delegator.getEntityFieldType(entity,field.getType());
+                    ModelFieldType type = delegator.getEntityFieldType(entity, field.getType());
 
                     if (ufields.contains(field.getName())) {
                         warningList.add("[FieldNotUnique] Field [" + field.getName() + " of entity " + entity.getEntityName() + " is not unique for that entity.");
diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelReader.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelReader.java
index 6ba7325..4573873 100644
--- a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelReader.java
+++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelReader.java
@@ -409,7 +409,7 @@ public class ModelReader implements Serializable {
                                             if (Debug.infoOn()
                                                     && !(title + curModelEntity.getEntityName()).equals(modelRelation.getTitle() + modelRelation.getRelEntityName())) {
                                                 // String errorMsg = "Relation already exists to entity [] with title ["
-                                                // + targetTitle + "],from entity []";
+                                                // + targetTitle + "], from entity []";
                                                 String message = "Entity [" + relatedEnt.getPackageName() + ":" + relatedEnt.getEntityName()
                                                         + "] already has identical relationship to entity [" + curModelEntity.getEntityName() + "] title [" + title
                                                         + "]; would auto-create: type [" + newRel.getType() + "] and fields [" + newRel.keyMapString(",", "") + "]";
diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelViewEntity.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelViewEntity.java
index 95249b9..9a92143 100644
--- a/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelViewEntity.java
+++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelViewEntity.java
@@ -1405,7 +1405,7 @@ public class ModelViewEntity extends ModelEntity {
             if (!((this.operator == EntityOperator.IN || this.operator == EntityOperator.BETWEEN)
                     && value instanceof Collection<?>)) {
                 // now to a type conversion for the target fieldName
-                value = this.viewEntityCondition.modelViewEntity.convertFieldValue(lhsField, value,modelFieldTypeReader, new HashMap<>());
+                value = this.viewEntityCondition.modelViewEntity.convertFieldValue(lhsField, value, modelFieldTypeReader, new HashMap<>());
             }
 
             if (Debug.verboseOn()) Debug.logVerbose("[" + this.viewEntityCondition.modelViewEntity.getEntityName() + "]: Got value for fieldName [" + fieldName + "]: " + value, MODULE);
diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtil.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtil.java
index 7187eaf..c3dfe38 100644
--- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtil.java
+++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtil.java
@@ -425,7 +425,7 @@ public final class EntityUtil {
                     }
                     entity.remove("thruDate");
                 } else {
-                    entity.set("thruDate",now);
+                    entity.set("thruDate", now);
                 }
                 entity.store();
             }
@@ -443,7 +443,7 @@ public final class EntityUtil {
         if (now.equals(search.get("fromDate"))) {
             return EntityUtil.getOnly(EntityQuery.use(delegator).from(entityName).where(search).queryList());
         } else {
-            search.put("fromDate",now);
+            search.put("fromDate", now);
             search.remove("thruDate");
             return delegator.makeValue(entityName, search);
         }
@@ -456,7 +456,7 @@ public final class EntityUtil {
     public static void delDatedInclusionEntity(Delegator delegator, String entityName, Map<String, ? extends Object> search, Timestamp now) throws GenericEntityException {
         List<GenericValue> entities = findDatedInclusionEntity(delegator, entityName, search, now);
         for (GenericValue entity: entities) {
-            entity.set("thruDate",now);
+            entity.set("thruDate", now);
             entity.store();
         }
     }
diff --git a/framework/security/src/main/java/org/apache/ofbiz/security/Security.java b/framework/security/src/main/java/org/apache/ofbiz/security/Security.java
index 507be35..ed7179d 100644
--- a/framework/security/src/main/java/org/apache/ofbiz/security/Security.java
+++ b/framework/security/src/main/java/org/apache/ofbiz/security/Security.java
@@ -54,7 +54,7 @@ public interface Security {
 
     /**
      * Finds whether or not a SecurityGroupPermission row exists given a groupId and permission.
-     * The groupId,permission pair is cached instead of the userLoginId,permission pair to keep the cache small and to
+     * The groupId, permission pair is cached instead of the userLoginId, permission pair to keep the cache small and to
      * make it more changeable.
      *
      * @param groupId The ID of the group
diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
index 3b20718..895265b 100644
--- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
+++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
@@ -602,7 +602,7 @@ public class RequestHandler {
                 String link = makeLink(request, response, redirectTarget);
 
                 // add / update csrf token to link when required
-                String tokenValue = CsrfUtil.generateTokenForNonAjax(request,redirectTarget);
+                String tokenValue = CsrfUtil.generateTokenForNonAjax(request, redirectTarget);
                 link = CsrfUtil.addOrUpdateTokenInUrl(link, tokenValue);
 
                 callRedirect(link, response, request, ccfg.getStatusCode());
diff --git a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java
index 0d0c88c..be5b615 100644
--- a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java
+++ b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java
@@ -85,7 +85,7 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
             // we can do something with this!
             SimpleMethod simpleMethodToCall = null;
             try {
-                simpleMethodToCall = SimpleMethod.getSimpleMethod(this.modelService.location, this.modelService.invoke,null);
+                simpleMethodToCall = SimpleMethod.getSimpleMethod(this.modelService.location, this.modelService.invoke, null);
             } catch (MiniLangException e) {
                 Debug.logWarning("Error getting Simple-method [" + this.modelService.invoke + "] in [" + this.modelService.location + "] referenced in service [" + this.modelService.name + "]: " + e.toString(), MODULE);
             }
@@ -144,7 +144,7 @@ public class ServiceArtifactInfo extends ArtifactInfoBase {
             // we can do something with this!
             SimpleMethod simpleMethodToCall = null;
             try {
-                simpleMethodToCall = SimpleMethod.getSimpleMethod(this.modelService.location, this.modelService.invoke,null);
+                simpleMethodToCall = SimpleMethod.getSimpleMethod(this.modelService.location, this.modelService.invoke, null);
             } catch (MiniLangException e) {
                 Debug.logWarning("Error getting Simple-method [" + this.modelService.invoke + "] in [" + this.modelService.location + "] referenced in service [" + this.modelService.name + "]: " + e.toString(), MODULE);
             }

Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] 02/02: Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-framework into trunk

surajk
In reply to this post by surajk
This is an automated email from the ASF dual-hosted git repository.

surajk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git

commit 443025e37fdbad9715a24430be176b2ee5370bad
Merge: fc6b8a6 c52e437
Author: Suraj Khurana <[hidden email]>
AuthorDate: Tue Jul 7 15:10:53 2020 +0530

    Merge branch 'trunk' of https://gitbox.apache.org/repos/asf/ofbiz-framework into trunk

 applications/order/minilang/test/OrderTests.xml    | 141 -------------
 .../org/apache/ofbiz/order/OrderTests.groovy       | 107 ++++++++++
 applications/order/testdef/OrderTest.xml           |   2 +-
 .../minilang/shipment/test/ShipmentTests.xml       | 218 ---------------------
 .../org/apache/ofbiz/product/ShipmentTests.groovy  | 203 +++++++++++++++++++
 applications/product/testdef/FacilityTest.xml      |   2 +-
 build.gradle                                       |   2 +-
 .../apache/ofbiz/common/login/LoginServices.java   |   4 +-
 framework/security/config/security.properties      |   8 +-
 9 files changed, 321 insertions(+), 366 deletions(-)

diff --cc framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java
index e38ddba,ef84b93..6401a0b
--- a/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java
+++ b/framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java
@@@ -1039,12 -1039,12 +1039,12 @@@ public class LoginServices
 
          String errMsg = null;
 
+         // if it's a system account (aka adminUser) don't bother checking the passwords
          if (!ignoreCurrentPassword) {
              // if the password.accept.encrypted.and.plain property in security is set to true allow plain or encrypted passwords
-             // if this is a system account don't bother checking the passwords
              boolean passwordMatches = checkPassword(userLogin.getString("currentPassword"), useEncryption, currentPassword);
              if ((currentPassword == null) || (!passwordMatches)) {
 -                errMsg = UtilProperties.getMessage(RESOURCE,"loginservices.old_password_not_correct_reenter", locale);
 +                errMsg = UtilProperties.getMessage(RESOURCE, "loginservices.old_password_not_correct_reenter", locale);
                  errorMessageList.add(errMsg);
              }
              if (checkPassword(userLogin.getString("currentPassword"), useEncryption, newPassword)) {