You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ug...@apache.org on 2004/04/19 01:17:39 UTC

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/util NetUtils.java

ugo         2004/04/18 16:17:39

  Modified:    src/java/org/apache/cocoon/util NetUtils.java
  Log:
  Make NetUtilsTestCase succeed.
  
  Revision  Changes    Path
  1.11      +9 -1      cocoon-2.1/src/java/org/apache/cocoon/util/NetUtils.java
  
  Index: NetUtils.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/util/NetUtils.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- NetUtils.java	28 Mar 2004 14:28:04 -0000	1.10
  +++ NetUtils.java	18 Apr 2004 23:17:39 -0000	1.11
  @@ -354,6 +354,14 @@
           }
   
           StringBuffer b = new StringBuffer(uri.length());
  +        
  +        // Added this check to satisfy NetUtilsTestCase. I cannot ascertain whether
  +        // this is correct or not, since the description of this method is not very
  +        // clear. [Ugo Cei <ug...@apache.org> 2004-04-19]
  +        if (uri.charAt(0) == '/') {
  +            b.append('/');
  +        }
  +        
           for (int i = 0; (i < length) && (clean[i] != null); i++) {
               b.append(clean[i]);
               if ((i+1 < length) && (clean[i+1] != null)) {