[ofbiz-plugins] branch trunk updated: Improved: Make data members of class as private and added accessor methods for the same, also corrected occurences of the same in plugins component. (OFBIZ-11963) Also made some related checkstyle code enhancements. Thanks Jacques for review.

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

[ofbiz-plugins] branch trunk updated: Improved: Make data members of class as private and added accessor methods for the same, also corrected occurences of the same in plugins component. (OFBIZ-11963) Also made some related checkstyle code enhancements. Thanks Jacques for review.

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-plugins.git


The following commit(s) were added to refs/heads/trunk by this push:
     new f21eda4  Improved: Make data members of class as private and added accessor methods for the same, also corrected occurences of the same in plugins component. (OFBIZ-11963) Also made some related checkstyle code enhancements. Thanks Jacques for review.
f21eda4 is described below

commit f21eda4542c9ebe5cd38ed3e7aefe5ee5ec6b6a1
Author: Suraj Khurana <[hidden email]>
AuthorDate: Sat Sep 12 11:57:19 2020 +0530

    Improved: Make data members of class as private and added accessor methods for the same, also corrected occurences of the same in plugins component.
    (OFBIZ-11963)
    Also made some related checkstyle code enhancements. Thanks Jacques for review.
---
 .../apache/ofbiz/birt/report/servlet/ViewerServletRequest.java |  3 +--
 .../org/apache/ofbiz/birt/webapp/view/BirtViewHandler.java     |  5 ++---
 .../OFBizActiveDirectoryAuthenticationHandler.java             |  2 +-
 .../ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java    |  2 +-
 solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java   | 10 +++++-----
 5 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/ViewerServletRequest.java b/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/ViewerServletRequest.java
index abb00a8..b701406 100644
--- a/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/ViewerServletRequest.java
+++ b/birt/src/main/java/org/apache/ofbiz/birt/report/servlet/ViewerServletRequest.java
@@ -31,8 +31,7 @@ import org.apache.ofbiz.base.util.Debug;
 
 public class ViewerServletRequest extends HttpServletRequestWrapper {
     private static final String MODULE = ViewerServletRequest.class.getName();
-
-    protected String originalReportParam = null;
+    private String originalReportParam = null;
 
     public ViewerServletRequest(String originalReportParam, HttpServletRequest request) {
         super(request);
diff --git a/birt/src/main/java/org/apache/ofbiz/birt/webapp/view/BirtViewHandler.java b/birt/src/main/java/org/apache/ofbiz/birt/webapp/view/BirtViewHandler.java
index 7878aef..08c5393 100644
--- a/birt/src/main/java/org/apache/ofbiz/birt/webapp/view/BirtViewHandler.java
+++ b/birt/src/main/java/org/apache/ofbiz/birt/webapp/view/BirtViewHandler.java
@@ -53,8 +53,7 @@ public class BirtViewHandler implements ViewHandler {
 
     private static final String MODULE = BirtViewHandler.class.getName();
     private static final String RES_ERROR = "BirtErrorUiLabels";
-
-    protected ServletContext servletContext = null;
+    private ServletContext servletContext = null;
 
     private String name = "birt";
 
@@ -103,7 +102,7 @@ public class BirtViewHandler implements ViewHandler {
 
             Map<String, Object> context = new HashMap<>();
             // set parameters from request
-             Map<String, Object> parameters = UtilGenerics.cast(request.getAttribute(BirtWorker.getBirtParameters()));
+            Map<String, Object> parameters = UtilGenerics.cast(request.getAttribute(BirtWorker.getBirtParameters()));
             if (parameters != null) {
                 context.put(BirtWorker.getBirtParameters(), parameters);
             } else {
diff --git a/ldap/src/main/java/org/apache/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java b/ldap/src/main/java/org/apache/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java
index 6377154..78fbea7 100644
--- a/ldap/src/main/java/org/apache/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java
+++ b/ldap/src/main/java/org/apache/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java
@@ -94,7 +94,7 @@ public final class OFBizActiveDirectoryAuthenticationHandler extends AbstractOFB
             attribute = LdapUtils.getFilterWithValues(attribute, username);
             NamingEnumeration<SearchResult> answer = ctx.search(baseDN,
                     // Filter expression
-                    "(&(" + filter + ") (" + attribute +"))",
+                    "(&(" + filter + ") (" + attribute + "))",
                     controls);
             if (answer.hasMoreElements()) {
                 result = answer.next();
diff --git a/ldap/src/main/java/org/apache/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java b/ldap/src/main/java/org/apache/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java
index ed4632a..2a8c071 100644
--- a/ldap/src/main/java/org/apache/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java
+++ b/ldap/src/main/java/org/apache/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java
@@ -79,7 +79,7 @@ public final class OFBizLdapAuthenticationHandler extends AbstractOFBizAuthentic
             attribute = LdapUtils.getFilterWithValues(attribute, username);
             NamingEnumeration<SearchResult> answer = ctx.search(baseDN,
                     // Filter expression
-                    "(&(" + filter + ") (" + attribute +"))",
+                    "(&(" + filter + ") (" + attribute + "))",
                     controls);
             if (answer.hasMoreElements()) {
                 result = answer.next();
diff --git a/solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java b/solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java
index 8b626c4..0305a70 100644
--- a/solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java
+++ b/solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java
@@ -52,7 +52,7 @@ public class SolrTests extends OFBizTestCase {
      */
     public void testAddProductToIndex() throws Exception {
 
-        GenericValue product = EntityQuery.use(delegator).from("Product").where("productId", validTestProductId).queryOne();
+        GenericValue product = EntityQuery.use(getDelegator()).from("Product").where("productId", validTestProductId).queryOne();
 
         Map<String, Object> ctx = new HashMap<>();
         ctx.put("instance", product);
@@ -117,8 +117,8 @@ public class SolrTests extends OFBizTestCase {
         List<Map<String, Object>> products = new ArrayList<>();
         Map<String, Object> product1 = new HashMap<>();
         Map<String, Object> product2 = new HashMap<>();
-        GenericValue validTestProduct = EntityQuery.use(delegator).from("Product").where("productId", validTestProductId).queryOne();
-        GenericValue validTestProduct2 = EntityQuery.use(delegator).from("Product").where("productId", validTestProductId2).queryOne();
+        GenericValue validTestProduct = EntityQuery.use(getDelegator()).from("Product").where("productId", validTestProductId).queryOne();
+        GenericValue validTestProduct2 = EntityQuery.use(getDelegator()).from("Product").where("productId", validTestProductId2).queryOne();
 
         product1.put("productId", validTestProduct);
         product2.put("productId", validTestProduct2);
@@ -145,8 +145,8 @@ public class SolrTests extends OFBizTestCase {
         List<Map<String, Object>> products = new ArrayList<>();
         Map<String, Object> product1 = new HashMap<>();
         Map<String, Object> product2 = new HashMap<>();
-        GenericValue testProduct = EntityQuery.use(delegator).from("Product").where("productId", validTestProductId).queryOne();
-        GenericValue testProduct2 = EntityQuery.use(delegator).from("Product").where("productId", validTestProductId2).queryOne();
+        GenericValue testProduct = EntityQuery.use(getDelegator()).from("Product").where("productId", validTestProductId).queryOne();
+        GenericValue testProduct2 = EntityQuery.use(getDelegator()).from("Product").where("productId", validTestProductId2).queryOne();
 
         testProduct.replace("productId", invalidTestProductId);
         testProduct.replace("productId", invalidTestProductId);