svn commit: r1759578 - in /ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp: control/LoginWorker.java website/WebSiteWorker.java

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

svn commit: r1759578 - in /ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp: control/LoginWorker.java website/WebSiteWorker.java

jacopoc
Author: jacopoc
Date: Wed Sep  7 10:32:47 2016
New Revision: 1759578

URL: http://svn.apache.org/viewvc?rev=1759578&view=rev
Log:
Minor improvements, with no functional changes: made fields and methods private, moved variables into inner scope.

Modified:
    ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java
    ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/website/WebSiteWorker.java

Modified: ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java?rev=1759578&r1=1759577&r2=1759578&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java (original)
+++ ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/LoginWorker.java Wed Sep  7 10:32:47 2016
@@ -96,7 +96,7 @@ public class LoginWorker {
 
     private static final String keyValue = UtilProperties.getPropertyValue(securityProperties, "login.secret_key_string");
     /** This Map is keyed by the randomly generated externalLoginKey and the value is a UserLogin GenericValue object */
-    public static Map<String, GenericValue> externalLoginKeys = new ConcurrentHashMap<String, GenericValue>();
+    private static Map<String, GenericValue> externalLoginKeys = new ConcurrentHashMap<String, GenericValue>();
 
     public static StringWrapper makeLoginUrl(PageContext pageContext) {
         return makeLoginUrl(pageContext, "checkLogin");
@@ -1059,13 +1059,11 @@ public class LoginWorker {
         if (userLogin != null) {
             //to check it's the right tenant
             //in case username and password are the same in different tenants
-            LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
             Delegator delegator = (Delegator) request.getAttribute("delegator");
             String oldDelegatorName = delegator.getDelegatorName();
-            ServletContext servletContext = session.getServletContext();
             if (!oldDelegatorName.equals(userLogin.getDelegator().getDelegatorName())) {
                 delegator = DelegatorFactory.getDelegator(userLogin.getDelegator().getDelegatorName());
-                dispatcher = WebAppUtil.makeWebappDispatcher(servletContext, delegator);
+                LocalDispatcher dispatcher = WebAppUtil.makeWebappDispatcher(session.getServletContext(), delegator);
                 setWebContextObjects(request, response, delegator, dispatcher);
             }
             // found userLogin, do the external login...

Modified: ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/website/WebSiteWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/website/WebSiteWorker.java?rev=1759578&r1=1759577&r2=1759578&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/website/WebSiteWorker.java (original)
+++ ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/website/WebSiteWorker.java Wed Sep  7 10:32:47 2016
@@ -49,18 +49,7 @@ public final class WebSiteWorker {
             return null;
         }
 
-        return findWebSite((Delegator) request.getAttribute("delegator"), webSiteId);
-    }
-
-    /**
-     * returns a WebSite-GenericValue (using entityCache)
-     *
-     * @param delegator
-     * @param webSiteId
-     * @return
-     */
-    public static GenericValue findWebSite(Delegator delegator, String webSiteId) {
-        return findWebSite(delegator, webSiteId, true);
+        return findWebSite((Delegator) request.getAttribute("delegator"), webSiteId, true);
     }
 
     /**
@@ -71,7 +60,7 @@ public final class WebSiteWorker {
      * @param useCache
      * @return
      */
-    public static GenericValue findWebSite(Delegator delegator, String webSiteId, boolean useCache) {
+    private static GenericValue findWebSite(Delegator delegator, String webSiteId, boolean useCache) {
         GenericValue result = null;
         try {
             result = EntityQuery.use(delegator).from("WebSite").where("webSiteId", webSiteId).cache(useCache).queryOne();