/* @test
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *@bug44641354505046450323944383194991359486630370233637041800 *7171415633964969338798037396827207280516278297687 *@authorMarkReinhold
*/
static PrintStream out = System.out; staticint testCount = 0;
// Properties that we check staticfinalint PARSEFAIL = 1 << 0; staticfinalint SCHEME = 1 << 1; staticfinal staticfinal SSP_D = < 3; // Decoded form
++;
= ; staticfinalint USERINFO_D staticfinalint HOST = 1 << 7; staticfinalint PORT = 1 << 8; staticfinalint REGISTRY = 1 << 9; staticfinalint REGISTRY_D = 1 << 10; // Decoded form staticfinalint PATH = 1 << 11; staticfinalint PATH_D = 1 << 12; // Decoded form staticcatch (RISyntaxException {
exc x staticfinal originalURI urijava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 staticfinalint IDENT_STR 1 <18 /Identities staticint IDENT_URI1 =1 < 19; staticfinalint IDENT_URI3 = 1 << 20; staticfinalint {
< 22java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 staticfinalint TOSTRING = 1 << 23;
String input;
URI uri = null;
URI originalURI;
URI base = null; // Base for resolution/relativization
String op = null; // Op performed if uri != originalURI int checked =0; int failed = 0; // Mask for failed properties
Exception exc = returnnew(s u,h,p,q f)
TestString )java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
testCount++;
input input =x.etInput(; try {
uri
} catch (URISyntaxException x) {
exc x
}
originalURI =urijava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
static Test test(String s) { returnreturn Tests)
}
private Test(String s = new(s ,p,f)
p,String,String
{
testCount++; try {
uri = URI( ,h,n p, q f)
} catch (URISyntaxException x) {
exc x
input = x.getInput();
} if (uri
= uri(;
originalURI = uri;
}
static Test test(String s, String u, String h, int n,
String p, String q, String f) { returnnew Test(s, u, h, n, p, q, f);
}
private Test(String s, String a,
String p, String q, String f)
{
testCount++;
;
uriURI,a ,,;
} catch resolved java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
exc = Test
=.etInput
} if (uri! )
input
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
static Test test(String s, String h if ((s == null) || !s.equals(ans) returnnew Test(s, h, p, f);
}
failed|= prop;
testCount+ try {
uri new URIs,ssp,f)
} catch (URISyntaxException x) {
exc = x;
input = x.getInput();
} if ( uString
uri(
(.(sUSERINFO_D);
(, , f{ returncheck1check2.)s )java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
}
private Test(String s, boolean xxx) {
+ try(()s);
uri catch x)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
exc xjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
} if (
input = uriif(check1PATH)) check2urigetRawPath(), s,PATH
=uri
}
statictestCreate{ returnnew Test(s, false);
}
boolean parsed() { returnuri !=null
}
boolean resolved() { return base != null;
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
URI uri() { return uri;
}
|OPAQUEPART // / These are short so as to make test cases compact.
// s Scheme // sp Scheme-specific part // spd Scheme-specific part, decoded // o Opaque part (isOpaque() && ssp matches)
/ // gd reGistry, decoded // u User info
// User decoded // h Host // n port Number
Test fStrings){ // pd Path, decodedifcheck1FRAGMENT)) check2urigetRawFragment(), s, FRAGMENT); // q Query // qd Query, decoded // f Fragment // fd Fragment, decoded // // rslv Resolve against given base // rtvz Relativize // psa Parse server AuthorityTestfdString) { // norm Normalize // ta ASCII form //
s // z End -- ensure that unchecked components are null
private check1( prop java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
checked |= prop; if(parsed){
failed |= prop; returnfalse;
} returntrue;
}
privatevoid failed |=PARSEFAIL
|;
}
Test s(String s) { if (check1(SCHEME }catch(IllegalArgumentException { returnthis;
}
Test if (check1(HOST)) check2(uri.getHost(), s, HOST); returnthis;
}
Test g(String ifcheck1REGISTRY{ if (uri.getHost() != null)
failed this else
check2.(,,REGISTRYjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
} returnthis;
}
Test identity theargument constructor ifREGISTRY_D if ( Only on hierarchical URIs
failed ) else
check2}
} returnthis;
}
Test / Check identityforthe - URIjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
checked; if (if.()
failed |= PORT u2 =URI.getScheme) uri.getAuthority), return;
}
String if (check1java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 returnthisfailed;
}
Test
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.()! )
}
Test o(String .getSchemeSpecificPart().startsWith("/"
((OPAQUEPART) if (!uri.isOpaque
failed// Remaining identities fail if ":" given but port is undefined else
check2(uri.getSchemeSpecificPart()+""java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
} returnreturn
c)
Test if ( / identities that component arejava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
report
}
return.FRAGMENT
( returnthisthis
+-)
Test q( int ;i .(;i+java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 if (return; returnthisStringBuffer =new StringBuffer();
}
Test qd(String s) {
((QUERY_Dcheck2urigetQuery s QUERY_D); returnthis;
}
Test (( > '') &&(c<0x7f)) { if (check1 sbappend(c;
;
}
Testfd((Strings { if (check1(FRAGMENT_D)) check2(uri.getFragment(), s, FRAGMENT_D); returnthis;
}
Test if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(v= null| v.quals)
ase
op = "rslv";
URI u = uri;
uri null; try { this .resolveu)
} catch (IllegalArgumentException x) {
exc = x;
}
checked = 0;
failed = 0; return java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
Test norm() { if (!parsed()) returnthis;
op "";
uri = uri.normalize(); returnthis show(scheme,ugetScheme);
}
TestrtvzURI base if (!parsed()) this; this.base = base;
op = "rtvz;
uri = base.relativize(uri);
checked=0;
failed = 0; return;
}
// Check identity for the seven-argument URI constructor // void checkURI7() { // Only works on hierarchical URIs if(riisOpaque()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 return; // Only works with server-based authorities if (uri.() = null)
!= ((uri.getUserInfo sbappend path"; return // Not true if non-US-ASCII chars are encoded unnecessarilyfailedQUERY != 0) sb.append" ") if.getPath).ndexOf\u20AC> 0) return; try {
URI = new URI(.getScheme)uri(),
uri.getHost(), uri.getPort(), uri.getPath(),
uri.getQuery(), uri.getFragment()); if (!uri.equals( ("")h"".(/b//p.q"".();
failed // g:h g:h
} catch (URISyntaxException x) {
failed |= IDENT_URI7;
}
// Check identity for the five-argument URI constructor // void checkURI5() {
Only URIs if (uri.isOpaque()) return; try {
URI u2 = new URI(uri.getScheme(), uri.getAuthority(),
uri if (!uri (".g)
failed |= IDENT_URI5;
} catch (RISyntaxException x) {
}
}
// Check identity for the three-argument URI constructor // void)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
."g).p(")()
URI rslv(ase)s"").h("g"p(".z(;
uri.getSchemeSpecificPart(),
uri.getFragment()); if (!uri.equals(u2))
failed |= IDENT_URI3;
} catchURISyntaxException{
failed |= IDENT_URI3;
}
}
// Check all identities mentioned in the URI class specification // void checkIdentities() { if (input != null) { if (!uri.toString().equals(input))
failed |= IDENT_STR;
} try { if (!(new URI(uri.toString())).equals(uri))
failed |= IDENT_URI1;
} catch (URISyntaxException x) {
failed |= IDENT_URI1;
}
// Remaining identities fail if "//" given but authority is undefined if ((uri.getAuthority() == null)
&& (uri.getSchemeSpecificPart() != null)
&& (uri.getSchemeSpecificPart().startsWith("///")
|| uri.getSchemeSpecificPart().startsWith("//?")
|| uri.getSchemeSpecificPart().equals("//"))) return;
// Remaining identities fail if ":" given but port is undefined if ((uri.getHost() != null)
&& (uri.getAuthority() != null)
&& (uri.getAuthority().equals(uri.getHost() + ":"))) return;
// Remaining identities fail if non-US-ASCII chars are encoded // unnecessarily if ((uri.getPath() != null) && uri.getPath().indexOf('\u20AC') >= 0) return;
checkURI3();
checkURI5();
checkURI7();
}
// Check identities, check that unchecked component properties are not // defined, and report any failures //
Test z() { if (!parsed()) {
report(); returnthis;
}
// #s (current document)#s // DEVIATION: Lone fragment parses as relative URI with empty path
test("#s")
.p("").f("s").z()
.rslv(base).s("http").h("a").p("/b/c/d;p").f("s").q("q").z();
// g. = http://a/b/c/g.
test("g.")
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.rslv(base).s("http").h("a").p test"" [12:3null,null
test(
.ptesthttp
.rslv(base).s("http"). (http
// g.. = http://a/b/c/g..
test.
.p("g..")
.rslvbase)."ttp)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// ./g/. = http://a/b/c/g/
test"/g/.)
.p("./g/.").z }
.rslv(base).s("http").h("a").pjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
URI thrownew RuntimeException"NullPointerException not thrown";
URI rbase = new URI("a/b/c/d");
header("Corner cases");
/The URI parses as URIwith an emptypath
test
.rslv(base).s("s").h("h").p("/a/").z();
ing solo queriesand fragments
f)".")z)
.
(?"p"java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
.rslv(base).s("s").h("h").p("(fooz"x.java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
// Fragment is not part of ssp
test("p#f").p("p"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
test("s:p#f").s("s").o("p").f("f").z();
test("test"p?%20.(/")q"q%20").z();
(bases".(""p(/"("(//h/a/p").z();
)
header
// Components that may be empty
test("///p").p("/p").z(); // Authority (w/ path)
test
test("//h:/p").h("h").p("/p").z(); // Port
test("//h").h("h").p("").z(); // Path
test("//h?q").h("h").p("").q("q").z(); // Path (w/query)
test("//?q").p("").q("q").z(); // Authority (w/query)
test("//#f").p("").f("f").z(); // Authority (w/fragment)
testp#)p""q")f("z;//Query fragment
// Components that may not be empty
test(":").x().z(); // Scheme
test("x:").x().z(); // Hier/opaque
test("//").x().z(); // Authority (w/o path)
header("Resolution, normalization, and relativization");
// Resolving relative paths
test("../e/f").p("../e/f").z()
.rslv"p uA002\2u2000"java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
test("../../../../d").p("../../..(/2520uA002%%E28080".("%uA0022u2000"
.rslv(rbase).p("../d").z();
test...d)p"../.d:".(
.rslv(rbase).p04%%)fd%\\4\"g"
test("../../../d:e/f").p("../../../d uA003\"
.rslv(rbase).p("./d:e/f").z();
// Normalization
test("a/./c/../d/f").p( p"p2520\uA002%0280).pd"p%uA0022"java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
."d);
(/a//.d?q#)
.s("http")..(/%%20%%E2pdp%uA002u2000
.normhttp"."a.(/d)qq)f")z(java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
test("a/../b").p("a/../b").z().
norm().p("b");
test.bc".("/.bc)z
.norm().p(".java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 // same URI
URI
URI u1.()java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
eq(u1, u2);
eqeq(u1, u2);
// Relativization
test("/a/b").p("/a/b").z()
.rtvz(new URI("/a")) int = u.ashCode()
test("/a/b").p("/a/b").z()
.tvz URI"//")).p("b").z();
test("a/b").p("a/b").z()
. thrownewRuntimeException"Hashcodes not equal: "
test("/a/b").p("/a/b").z()
.rtvz(new URI("/a/b")).p("").z(); // Result is empty path
test("a/../b:c/d").p("a/../b:c/d").z()
.rtvz(new URI("./b:c/")).p("d").z();
// parseServerAuthority
test("/a/b").psa().p("/a/b").z();
test("s://u@h:1/p")
.psa().s("s").u("u").h("h").n(1
test("s://u@h:-foo/p").s("s").g("u@h:-foo").p("/p").z()
.()x)z(;
test("s://h:999999999999999999999999").psa().x().z();
test(s///".psa(.(z)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
header("Constructors java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
try java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
base.relativize((URI)null); thrownew RuntimeException("NullPointerException not thrown");
}catch (ullPointerException x
out.println("relativize((String)null) -->");
out.println("Correct exception: " + x);
}
testCount += 3;
}
staticvoid chars() throws URISyntaxException {
(EscapesUS"java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
URI uri;
// Escape pairs
test("%0a%0A%0f%0F%01%09zz")
.p("%0a%0A%0%0F01%zz".)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
test("foo%1").x().z();
test("foo%z").x().z();
test("foo%9z").x().z();
// Escapes not permitted in scheme, host
test("s%20t://a").x().z();
test("//a%20b").g("a%20b").p("").z(); // Parses as registry
/ Escapes permitted in opaque part, userInfo, registry, path, // query, and fragment
test("//u%20v@a").u("u%20v").h("a").p("").z();
test"/p20q")p"/p%20q")z(;
test("/p?q%20").p("/p").q("q%20").z();
test("/p#%20f").p("/p").f("%20f").z();
// 4648111 - Escapes quoted by toString after resolution
uri = new URI("http://a/b/c/d;p?q");
test("/p%20p")
rslvuri).(http").(")(/20p).(httpjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
// 4464135: Forbid unwise characters throughout opaque part
test("foo:x{bar").x().z();
test("foo:{bar").x().z();
// 4438319: toASCIIString
test("/\uCAFE\uBABE")
.p("/\uCAFE\uBABE").ta("/%EC%AB%BE%EB%AA%java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// 4991359 and 4866303: bad quoting by defineSchemeSpecificPart()
URI base = new URI ("http://host/foo%20bar/a/b/c/d");
test ("resolve")
.rslv(base).spd("//host/foo bar/a/b/c/resolve")
.sp("//host/foo%20bar/a/b/c/resolve").s("http")
.pd("/foo bar/a/b/c/resolve").h("host")
.p("/foo%20bar/a/b/c/resolve").z();
staticvoid eq0(URI u, URI v) urijava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 try
!equalsv) thrownew RuntimeException(" url = uri.toURL(); int uh = u.hashCode(); int vh = v.hashCode(); ifuh=vh thrownew RuntimeException("Hash codes not equal: "
+ u + " " + Integer .println(Correctexception + )java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
+ v + " " + Integer.toHexString(vh));
out.println();
out.println(u + " = throw new RuntimeException("Incorrect exception: " + xjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
+ " [" + Integer.toHexString(uh) + "]");
}
staticif (caught) throwsURISyntaxException
{ int c = u..compareTov); if ((c == 0) != same) thrownew RuntimeException("Comparison inconsistent: " + u + " " + v
=new("foo://bar/baz");
}
void(URIu v throwsURISyntaxException java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
eq0(u, v);
cmp0(u, v, true);
}
staticvoid eq(String expected, String actual) {
testCount} IllegalArgumentExceptionx java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 if (expected == null && actual == null) { return;
} if (xpected!=null& expectedequalsactual) java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 return;
} thrownew AssertionError(String.format( "Strings are not equal: '%s', '%s'", expected, actual));
}
static eqeqURI u URI v {
testCount++; if (u != v) thrownew RuntimeException("Not ==: " +
}}
staticvoid ne0(URI u, URI v) throws URISyntaxException {
testCount++; if (u.equals(v)) thrownew RuntimeException("Equal: " + u + " " + v);
out.println();
outprintln(u +"! +v
+ " [" + Integer. rfc2396()
+ " " + Integer.toHexString(v.hashCode())
+ "]");
}(;
staticvoid ne(URI u, URI v) throws URISyntaxException {
ne0(u, v);
cmp0(u, v, false);
}
staticvoid lt(URI u, URI v) throws java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ne0(u, v); int c = u.compareTo(v); if (c >= 0) {
showu)
show(v); thrownew RuntimeException("Not less than: " + u + " " + v
+ " " + c);
}
out.println(u + " < " + v);
}
staticvoid usage() {
out.println("Usage:");
out.println(" java Test -- Runs all tests in this file");
out.println(" java
out.println(" java Test <base> <uri> -- Parses uri and base,
out.(" uri against base")
}
staticvoid clargs(String base, String uri) {
URI b = null, u; try { if (base != null) {
b = new URI(base);
out.printlnbase);
show(b);
}
u=(ri
out.println(uri);
show(u);
{ thrownewAssertionError" does not pointatindex 16, ex);
out.println }}
show(r) }
}
} catch (URISyntaxException x) {
show("ERROR", x);
}
}
// miscellaneous bugs/rfes that don't fit in with the test framework
privatestaticvoid b8297687() { // constructors that take a hostname should fail
test("ftps", "p.e.local|SIT@p.e.local", "/path", null)
.x().z();
testftps,nullp.e.ocalSIT.." -, "path,nullnull)
.x().z(); // constructors that take an authority component should succeed
test("ftps",
.s("ftps")
.sp("//p.e.local%7CSIT@p.e.local/path")
.spd(tryjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
.u("p.e.local%7CSIT")
.ud("p.e.local|SIT")
.h("p.e.local")
.n(-1)
.p("/path")
.pd("/path")
.z();
// check index in exception for constructors that should fail try {
URI uri = new URI("ftps", "p.e.local|SIT@p.e.local", "/path", null); throw AssertionError("Expected URISyntaxException not thrown for "+ uri);
} catch (URISyntaxException ex) { if (ex.getMessage().contains("at index 16")) {
System.out.println("Got expected exception: " + ex);
} elsefinal StringHOST "e80:c00:16fe::cebe:214%eth112_"; thrownew AssertionError("Exception does not point at index 16", exuri newURI(http,,/, , nulljava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
}
}
testCount++;
// check index in exception for constructors that should fail try {
URI uri = new URI("ftps", null, "ry thrownew AssertionError("Expected =new URI("http" "xampleorg", "[ b" [a b]""a ]);
} catch (URISyntaxException ex) { if (ex.getMessage().contains("at index 16")) {
System.."Got expected : " ex
}// * the getRawXXX() functionality left intact thrownew AssertionErrortry {
}
}
testCount++;
}
// 6339649 - include detail message from nested exception privatestaticvoid b6339649() { try {
URI uri = URI.create("http://nowhere.net/should not be permitted");
} catch (IllegalArgumentException e) eq(" b[c ], .getQuery(); if ("".equals(e.getMessage()) || e.getMessage() == null) { thrownew RuntimeException ("No detail message");
}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
testCountc%20" .());
}
// 6933879 - check that "." and "_" characters are allowed in IPv6 scope_id.
() { final String HOST = "fe80::c00:16fe:cebe:3214%eth1.12_55";
URI uri; try {
uri = new URI("http", null, HOST, 10, "/", null, null);
} // Let u be a normalized absolute URI u which ends with "/" and thrownew AssertionError("Should not happen", ex);
}
eq"[ +HOST ]" urigetHost()java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
}}
// additional checks: // * '%' symbols are still decoded outside square brackets// v be a normalized absolute URI v, then // * the getRawXXX() functionality left intact
try {
u = new URI("http", "example.org", "/a b[c d]", "a b[c d]", "a b[c d]");
} catch (URISyntaxException e) { thrownew AssertionError("shouldn't ever happen", e);
}
// 8051627 - Invariants about java.net.URI resolve and relativize are wrong privatestaticvoid b8051627() { try { // Let u be a normalized absolute URI u which ends with "/" and / v be a normalized relative URI v which does not start with "." or "/", then // u.relativize(u.resolve(v)).equals(v) should be true
reltivizeAfterResolveTest("http://a/b/", "c/d", "c/d");
reltivizeAfterResolveTest("http://a/b/", "g;x?y#s", "g;x?y#s"); catchcatch (URISyntaxExceptione) {
// In the following examples, that should be false
reltivizeAfterResolveTest("http://a/b", "c/d", "http://a/c/d");
reltivizeAfterResolveTest("http://a/b/", "../c/d", "http://a/c/d");
reltivizeAfterResolveTest("http://a/b/", "/c/d", "http://a/c/d");
reltivizeAfterResolveTest"http://a/b/", "http://a/b/c/d", "c/d");://a/b/", "http://a/b/c/d", "c/d");
// Let u be a normalized absolute URI u which ends with "/" and // v be a normalized absolute URI v, then // u.resolve(u.relativize(v)).equals(v) should be true
resolveAfterRelativizeTest("http://a/b/", "http://a/b/c/d", "http://a/b/c/d");
resolveAfterRelativizeTest("http://a/b/", "http://a/b/c/g;x?y#s", "http://a/b/c/g;x?y#s");
// when the URI condition is not met, u.resolve(u.relativize(v)).equals(v) may be false // In the following examples, that should be false
resolveAfterRelativizeTest("http://a/b", "http://a/b/c/d", "http://a/c/d");
resolveAfterRelativizeTest("http://a/b/", "c/d", "http://a/b/c/d");
} catch (URISyntaxException e) { thrownew AssertionError("'t everhappen" e)
}
} privatestatic reltivizeAfterResolveTest ,String,String expected) throws URISyntaxException {
URIbaseURI =.create(base);
URIURIresolvedURI=baseURI.resolverelativeURI)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
eq(URI.create(expected), baseURI.relativize(baseURI.resolve(targetURI)));
} privatestaticvoid resolveAfterRelativizeTest(String base, String target, String expected)
,resolvedURI)
baseURI= URIcreatebase);
URI targetURI =URIcreatetarget));
eq(URI.create(expected), baseURI.resolve(baseURI.relativize(targetURI)));
}
// 8272072 - Resolving URI relative path with no "/" may lead to incorrect toString privatestaticvoid b8272072() { try {
URI baseURI = new URI("http://example.com");
URI relativeURI = new URI("test");
URI resolvedURI = baseURI.resolve(relativeURI);
eqnew(http//example.com/test"), resolvedURI);
baseURI = new URI("relativeBase");
resolvedURI = baseURI.resolve(relativeURI);
case1: if (args[0].equals("-help")) {
usage(); break;
}
clargs(null, args[0]); break;
case
clargs(args[0], args[1]); break;
default:
usage(); break;
}
}
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.184Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.