acquire class lock before running static initializer; wrap exceptions thrown from static initializers in ExceptionInInitializerError instances

This commit is contained in:
Joel Dice
2007-08-01 17:48:36 -06:00
parent 6ddb8c839c
commit 1997ea6b8c
8 changed files with 129 additions and 67 deletions

View File

@ -1,9 +1,19 @@
package java.net;
public class URL {
private final String value;
public final class URL {
// private final String protocol;
// private final String host;
// private final int port;
// private final String file;
public URL(String s) throws MalformedURLException {
value = s;
// int colon = s.indexOf(':');
// int slash = s.indexOf('/');
// if (colon > 0 && (slash < 0 || colon < slash)) {
// protocol = s.substring(0, colon);
// // todo
// } else {
// throw new MalformedURLException(s);
// }
}
}