mirror of git://gcc.gnu.org/git/gcc.git
re PR libgcj/34369 (java.net.URI.relativize(URI) method returns incorrect results)
2008-01-21 Luciano Chavez <lnx1138@us.ibm.com> PR libgcj/34369: * java/net/URI.java (relativize): Check initial segment for trailing "/". From-SVN: r131701
This commit is contained in:
parent
d68e117b15
commit
e0c604077e
|
|
@ -1,3 +1,9 @@
|
||||||
|
2008-01-21 Luciano Chavez <lnx1138@us.ibm.com>
|
||||||
|
|
||||||
|
PR libgcj/34369:
|
||||||
|
* java/net/URI.java (relativize): Check initial segment for
|
||||||
|
trailing "/".
|
||||||
|
|
||||||
2007-12-05 Thomas Fitzsimmons <fitzsim@redhat.com>
|
2007-12-05 Thomas Fitzsimmons <fitzsim@redhat.com>
|
||||||
|
|
||||||
* gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java,
|
* gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/* URI.java -- An URI class
|
/* URI.java -- An URI class
|
||||||
Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Classpath.
|
This file is part of GNU Classpath.
|
||||||
|
|
||||||
|
|
@ -968,12 +968,18 @@ public final class URI
|
||||||
return uri;
|
return uri;
|
||||||
if (rawAuthority != null && !(rawAuthority.equals(uri.getRawAuthority())))
|
if (rawAuthority != null && !(rawAuthority.equals(uri.getRawAuthority())))
|
||||||
return uri;
|
return uri;
|
||||||
if (!(uri.getRawPath().startsWith(rawPath)))
|
String basePath = rawPath;
|
||||||
return uri;
|
if (!(uri.getRawPath().equals(rawPath)))
|
||||||
|
{
|
||||||
|
if (!(basePath.endsWith("/")))
|
||||||
|
basePath = basePath.concat("/");
|
||||||
|
if (!(uri.getRawPath().startsWith(basePath)))
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return new URI(null, null,
|
return new URI(null, null,
|
||||||
uri.getRawPath().substring(rawPath.length()),
|
uri.getRawPath().substring(basePath.length()),
|
||||||
uri.getRawQuery(), uri.getRawFragment());
|
uri.getRawQuery(), uri.getRawFragment());
|
||||||
}
|
}
|
||||||
catch (URISyntaxException e)
|
catch (URISyntaxException e)
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue