jericho     2003/01/04 23:56:09

  Modified:    src/util/org/apache/util URI.java
  Log:
  - Fix a bug of the relative URI construction not to set is_server flag
  - Fix to be able to set query, after the fragment identifer was automatically removed
  
  Revision  Changes    Path
  1.24      +12 -8     jakarta-slide/src/util/org/apache/util/URI.java
  
  Index: URI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/util/org/apache/util/URI.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- URI.java  22 Dec 2002 16:06:08 -0000      1.23
  +++ URI.java  5 Jan 2003 07:56:09 -0000       1.24
  @@ -435,7 +435,8 @@
           }
           if (base._is_opaque_part || relative._is_opaque_part) {
               this._scheme = base._scheme;
  -            this._is_opaque_part = relative._is_opaque_part;
  +            this._is_opaque_part = base._is_opaque_part ||
  +                relative._is_opaque_part;
               this._opaque = relative._opaque;
               this._fragment = relative._fragment;
               this.setURI();
  @@ -446,6 +447,7 @@
               this._is_net_path = relative._is_net_path;
               this._authority = relative._authority;
               if (relative._is_server) {
  +                this._is_server = relative._is_server;
                   this._userinfo = relative._userinfo;
                   this._host = relative._host;
                   this._port = relative._port;
  @@ -459,6 +461,7 @@
               this._is_net_path = base._is_net_path;
               this._authority = base._authority;
               if (base._is_server) {
  +                this._is_server = base._is_server;
                   this._userinfo = base._userinfo;
                   this._host = base._host;
                   this._port = base._port;
  @@ -2913,10 +2916,12 @@
               setURI();
               return;
           }
  +        // remove the fragment identifier
  +        escapedQuery = removeFragmentIdentifier(escapedQuery);
           if (!validate(escapedQuery, query))
               throw new URIException(URIException.ESCAPING,
                       "escaped query not valid");
  -        _query = removeFragmentIdentifier(escapedQuery);
  +        _query = escapedQuery;
           setURI();
       }
   
  @@ -3012,8 +3017,7 @@
           if (!validate(escapedFragment, fragment))
               throw new URIException(URIException.ESCAPING,
                       "escaped fragment not valid");
  -        // remove the fragment identifier
  -        _fragment = removeFragmentIdentifier(escapedFragment);
  +        _fragment = escapedFragment;
           setURI();
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to