[Yanel-commits] rev 44520 - public/yanel/trunk/src/core/java/org/wyona/yanel/core

michi at wyona.com michi at wyona.com
Tue Sep 1 10:07:43 CEST 2009


Author: michi
Date: 2009-09-01 10:07:43 +0200 (Tue, 01 Sep 2009)
New Revision: 44520

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/core/Environment.java
Log:
if clause fixed

Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/Environment.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/Environment.java	2009-09-01 07:58:29 UTC (rev 44519)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/Environment.java	2009-09-01 08:07:43 UTC (rev 44520)
@@ -37,11 +37,11 @@
     private String rcp;
     
     public Environment(HttpServletRequest request, HttpServletResponse response, Identity identity, String stateOfView, String resourceContainerPath) {
-        this.request = request;
-        this.response = response;
-        this.identity = identity;
-        this.sov = stateOfView;
-        this.rcp = resourceContainerPath;
+        setRequest(request);
+        setResponse(response);
+        setIdentity(identity);
+        setStateOfView(stateOfView);
+        setResourceContainerPath(resourceContainerPath);
     }
 
     public Identity getIdentity() {
@@ -68,8 +68,12 @@
      * Set state of view
      */
     public void setStateOfView(String state) {
-        if (StateOfView.LIVE.equals(state) || StateOfView.AUTHORING.equals(state)) {
-            log.warn("No such state '" + state + "' explicitely supported by Yanel!");
+        if (log.isDebugEnabled()) { // Do not enable this, because the string comparison below is time consuming
+            if (!(StateOfView.LIVE.equals(state) || StateOfView.AUTHORING.equals(state))) {
+                log.warn("No such state '" + state + "' explicitely supported by Yanel!");
+            } else {
+                log.debug("State of view: " + state);
+            }
         }
         this.sov = state;
     }



More information about the Yanel-commits mailing list