Imported GNU Classpath 0.90

Imported GNU Classpath 0.90
       * scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore.
       * gnu/classpath/jdwp/VMFrame.java (SIZE): New constant.
       * java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5.
       * java/lang/Math.java: New override file.
       * java/lang/Character.java: Merged from Classpath.
       (start, end): Now 'int's.
       (canonicalName): New field.
       (CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants.
       (UnicodeBlock): Added argument.
       (of): New overload.
       (forName): New method.
       Updated unicode blocks.
       (sets): Updated.
       * sources.am: Regenerated.
       * Makefile.in: Likewise.

From-SVN: r111942
This commit is contained in:
Mark Wielaard 2006-03-10 21:46:48 +00:00
parent 27079765d0
commit 8aa540d2f7
1367 changed files with 188789 additions and 22762 deletions

View file

@ -399,40 +399,59 @@ public final class URL implements Serializable
&& ! spec.regionMatches(colon, "://:", 0, 4))
context = null;
boolean protocolSpecified = false;
if ((colon = spec.indexOf(':')) > 0
&& (colon < slash || slash < 0))
{
// Protocol specified in spec string.
// Protocol may have been specified in spec string.
protocolSpecified = true;
protocol = spec.substring(0, colon).toLowerCase();
if (context != null && context.protocol.equals(protocol))
{
// The 1.2 doc specifically says these are copied to the new URL.
host = context.host;
port = context.port;
userInfo = context.userInfo;
authority = context.authority;
}
if (context != null)
{
if (context.protocol.equals(protocol))
{
// The 1.2 doc specifically says these are copied to the new URL.
host = context.host;
port = context.port;
userInfo = context.userInfo;
authority = context.authority;
}
else
{
// There was a colon in the spec. Check to see if
// what precedes it is a valid protocol. If it was
// not, assume that it is relative to the context.
URLStreamHandler specPh = getURLStreamHandler(protocol.trim());
if (null == specPh)
protocolSpecified = false;
}
}
}
else if (context != null)
if (!protocolSpecified)
{
// Protocol NOT specified in spec string.
// Use context fields (except ref) as a foundation for relative URLs.
colon = -1;
protocol = context.protocol;
host = context.host;
port = context.port;
userInfo = context.userInfo;
if (spec.indexOf(":/", 1) < 0)
{
file = context.file;
if (file == null || file.length() == 0)
file = "/";
}
authority = context.authority;
if (context != null)
{
// Protocol NOT specified in spec string.
// Use context fields (except ref) as a foundation for relative URLs.
colon = -1;
protocol = context.protocol;
host = context.host;
port = context.port;
userInfo = context.userInfo;
if (spec.indexOf(":/", 1) < 0)
{
file = context.file;
if (file == null || file.length() == 0)
file = "/";
}
authority = context.authority;
}
else // Protocol NOT specified in spec. and no context available.
throw new MalformedURLException("Absolute URL required with null"
+ " context: " + spec);
}
else // Protocol NOT specified in spec. and no context available.
throw new MalformedURLException("Absolute URL required with null"
+ " context: " + spec);
protocol = protocol.trim();