vgritsenko    02/04/21 10:36:05

  Modified:    src/java/org/apache/cocoon/environment/wrapper Tag:
                        cocoon_2_0_3_branch EnvironmentWrapper.java
  Log:
  minor optimizaton, code align
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.11.2.1  +33 -36    
xml-cocoon2/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
  
  Index: EnvironmentWrapper.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- EnvironmentWrapper.java   30 Mar 2002 05:27:14 -0000      1.11
  +++ EnvironmentWrapper.java   21 Apr 2002 17:36:05 -0000      1.11.2.1
  @@ -54,7 +54,6 @@
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.Request;
  -import org.apache.cocoon.environment.Session;
   import org.apache.log.Logger;
   
   import java.io.IOException;
  @@ -72,7 +71,7 @@
    * contains a <code>RequestWrapper</code> object.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Carsten Ziegeler</a>
  - * @version $Id: EnvironmentWrapper.java,v 1.11 2002/03/30 05:27:14 ovidiu Exp $
  + * @version $Id: EnvironmentWrapper.java,v 1.11.2.1 2002/04/21 17:36:05 vgritsenko 
Exp $
    */
   public class EnvironmentWrapper extends AbstractEnvironment implements Environment {
   
  @@ -158,10 +157,8 @@
   
           // check if session mode shall be activated
           if (sessionmode) {
  -            // The session
  -            Session session = null;
               // get session from request, or create new session
  -            session = request.getSession(true);
  +            request.getSession(true);
           }
       }
   
  @@ -246,7 +243,9 @@
        * context and the prefix is set.
        */
       public void setURI(String prefix, String uris) {
  -        getLogger().debug("Setting uri (prefix=" + prefix + ", uris=" + uris + ")");
  +        if(getLogger().isDebugEnabled()) {
  +            getLogger().debug("Setting uri (prefix=" + prefix + ", uris=" + uris + 
")");
  +        }
           if (prefix != null) {
               setContext(getRootContext());
               setURIPrefix(prefix);
  @@ -274,35 +273,33 @@
           this.uris = this.lastURI;
       }
   
  -  /**
  -   * Lookup an attribute in this instance, and if not found search it
  -   * in the wrapped environment.
  -   *
  -   * @param name a <code>String</code>, the name of the attribute to
  -   * look for
  -   * @return an <code>Object</code>, the value of the attribute or
  -   * null if no such attribute was found.
  -   */
  -  public Object getAttribute(String name)
  -  {
  -    Object value = super.getAttribute(name);
  -    if (value == null)
  -      value = environment.getAttribute(name);
  -
  -    return value;
  -  }
  -
  -  /**
  -   * Remove attribute from the current instance, as well as from the
  -   * wrapped environment.
  -   *
  -   * @param name a <code>String</code> value
  -   */
  -  public void removeAttribute(String name)
  -  {
  -    super.removeAttribute(name);
  -    environment.removeAttribute(name);
  -  }
  -}
  +    /**
  +     * Lookup an attribute in this instance, and if not found search it
  +     * in the wrapped environment.
  +     *
  +     * @param name a <code>String</code>, the name of the attribute to
  +     * look for
  +     * @return an <code>Object</code>, the value of the attribute or
  +     * null if no such attribute was found.
  +     */
  +    public Object getAttribute(String name)
  +    {
  +        Object value = super.getAttribute(name);
  +        if (value == null)
  +            value = environment.getAttribute(name);
   
  +        return value;
  +    }
   
  +    /**
  +     * Remove attribute from the current instance, as well as from the
  +     * wrapped environment.
  +     *
  +     * @param name a <code>String</code> value
  +     */
  +    public void removeAttribute(String name)
  +    {
  +        super.removeAttribute(name);
  +        environment.removeAttribute(name);
  +    }
  +}
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to