Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 56521 invoked by uid 500); 21 Apr 2002 17:36:05 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 56512 invoked by uid 500); 21 Apr 2002 17:36:05 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 21 Apr 2002 17:36:05 -0000 Message-ID: <20020421173605.71403.qmail@icarus.apache.org> From: vgritsenko@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/environment/wrapper EnvironmentWrapper.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 RequestWrapper object. * * @author Carsten Ziegeler - * @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 String, the name of the attribute to - * look for - * @return an Object, 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 String 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 String, the name of the attribute to + * look for + * @return an Object, 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 String value + */ + public void removeAttribute(String name) + { + super.removeAttribute(name); + environment.removeAttribute(name); + } +} ---------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: cocoon-cvs-help@xml.apache.org