This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

java/net/URL.getQuery


I have a signed copy of a copyright assignement from RMS now.


This is a Java2 routine not previously implemented.  Here's a patch
against the current HEAD:

@ spa:net$;cvs diff URL.java
cvs diff URL.java
Index: URL.java
===================================================================
RCS file: /cvsroot/gcc/gcc/libjava/java/net/URL.java,v
retrieving revision 1.10
diff -r1.10 URL.java
33a34
>   private String query = null;
95a97,108
> 
>     int queryAt = file.lastIndexOf('?');
>     if (queryAt < 0)
>       {
> 	this.path = file;
>       }
>     else
>       {
> 	this.path = file.substring(0, queryAt);
> 	this.query = file.substring(++queryAt);
>       }
> 
188a202,212
>     int queryAt = file.lastIndexOf('?');
>     if (queryAt < 0)
>       {
> 	this.path = file;
>       }
>     else
>       {
> 	this.path = file.substring(0, queryAt);
> 	this.query = file.substring(++queryAt);
>       }
> 
224,225c248,253
<     int quest = file.indexOf('?');
<     return quest < 0 ? file : file.substring(0, quest);
---
>     return path;
>   }
> 
>   public String getQuery() 
>   {
>     return query;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]