Index: AbstractEnvironment.java
===================================================================
RCS file: /home/cvspublic/xml-cocoon2/src/java/org/apache/cocoon/environment/AbstractEnvironment.java,v
retrieving revision 1.4
diff -u -r1.4 AbstractEnvironment.java
--- AbstractEnvironment.java	22 Jan 2002 00:17:12 -0000	1.4
+++ AbstractEnvironment.java	1 Feb 2002 18:42:41 -0000
@@ -181,22 +181,16 @@
      */
     public void changeContext(String prefix, String newContext)
     throws MalformedURLException {
-        if (getLogger().isDebugEnabled())
-        {
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug("Changing Cocoon context(" + newContext + ") to prefix(" + prefix + ")");
             getLogger().debug("\tfrom context(" + this.context.toExternalForm() + ") and prefix(" + this.prefix + ")");
             getLogger().debug("\tat URI " + this.uris);
         }
         if (prefix.length() >= 1 && !this.uris.startsWith(prefix)) {
-            if (getLogger().isErrorEnabled())
-            {
-                this.getLogger().error("The current URI ("
-                        + this.uris + ") doesn't start with given prefix ("
-                        + prefix + ")"
-                );
-            }
-
-            throw new RuntimeException("The current URI doesn't start with given prefix");
+            String message = "The current URI (" + this.uris +
+                             ") doesn't start with given prefix (" + prefix + ")";
+            getLogger().error(message);
+            throw new RuntimeException(message);
         }
         if (prefix.length() >= 1) {
             this.prefix.append(prefix);
@@ -209,24 +203,32 @@
             }
         }
 
-        //if the resource is zipped into a war file (e.g. Weblogic temp deployment)
         if (this.context.getProtocol().equals("zip")) {
+            // if the resource is zipped into a war file (e.g. Weblogic temp deployment)
+            getLogger().debug("Base context is zip: " + this.context);
             this.context = new URL(this.context.toString() + newContext);
-
-        // if we got a absolute context or one with a protocol resolve it
         } else {
+            // if we got a absolute context or one with a protocol resolve it
             if (newContext.charAt(0) == '/') {
+                // context starts with the '/' - absolute file URL
                 this.context = new URL("file:" + newContext);
+                getLogger().debug("New context is absolute file: " + this.context);
             } else if (newContext.indexOf(':') > 1) {
                 this.context = new URL(newContext);
+                getLogger().debug("New context is absolute url: " + this.context);
             } else {
+                // context is relative to old one
                 this.context = new URL(this.context, newContext);
+                getLogger().debug("New context is relative url: " + this.context);
             }
+
             File f = new File(this.context.getFile());
             if (f.isFile()) {
                 this.context = f.getParentFile().toURL();
+                getLogger().debug("New context is a file: " + this.context);
             } else {
                 this.context = f.toURL();
+                getLogger().debug("New context is not a file: " + this.context);
             }
         }
 

