Name: yyT116575 Date: 10/24/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
The constructor URL(URL, String) works different in 1.3 as in older versions.
For instance:
System.out.println(new URL(new URL("http://www.acme.com/a/"), "/a/./"));
will print:
http://www.acme.com/a/
on 1.2.2 and older versions, but on 1.3 it will print:
http://www.acme.com/a/./
This may not seem important, but in some cases it can cause endless growth of
URLs (e.g.: at web spidering).
source code:
import java.io.*;
import java.net.*;
public class JdkTest {
public static void main(String[] args) {
try {
System.out.println(new URL(new URL("http://www.acme.com/a/"), "/a/./"));
} catch (MalformedURLException e) {}
}
}
Best regards
Samo
(Review ID: 108866)
======================================================================