[8u] RFR: 8051853: new URI("x/").resolve("..").getSchemeSpecificPart() returns null!

Andrew Hughes gnu.andrew at redhat.com
Mon Sep 7 06:23:51 UTC 2020


On 17:32 Thu 03 Sep     , Alex Kashchenko wrote:
> Hi,
> 
> Please review the fix to 8051853 for 8u.
> 
> Note, the problem is not reproducible in 9+, it was fixed there as a
> part of "8146686: Create the schemeSpecificPart for non-opaque URIs
> lazily" .
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8051853
> 
> Related maillist discussion:
> https://mail.openjdk.java.net/pipermail/net-dev/2016-January/009467.html
> 
> Related point in 8146686:
> https://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/16296b4145d0#l1.30
> 
> 8u webrev: https://cr.openjdk.java.net/~akasko/jdk8u/8051853/webrev.00/
> 
> If appendSchemeSpecificPart() doesn't append anything to the specified
> buffer, then defineSchemeSpecificPart() returns early and
> schemeSpecificPart variable remains null. Proposed change removes
> "early return" branch.
> 
> --
> -Alex
> 

Looks good to me. A zero length StringBuffer can be converted to an empty
String ("") by the toString() method, so there is no need to special case
this. Amazes me this has been broken so long!

Thanks,
-- 
Andrew :)

Senior Free Java Software Engineer
OpenJDK Package Owner
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222


More information about the jdk8u-dev mailing list