8076290: JCK test api/xsl/conf/string/string17 starts failing after JDK-8074297

Reviewed-by: joehw
This commit is contained in:
Aleksei Efimov 2015-04-01 16:01:10 +03:00
parent d4502a832f
commit 75f2048a84

View file

@ -298,7 +298,7 @@ public final class BasisLibrary {
return(EMPTYSTRING);
int istart = (int)Math.round(start) - 1;
final int ilength = (int)Math.round(length);
int ilength = (int)Math.round(length);
final int isum;
if (Double.isInfinite(length))
isum = Integer.MAX_VALUE;
@ -309,8 +309,10 @@ public final class BasisLibrary {
if (isum < 0 || istart > strlen)
return(EMPTYSTRING);
if (istart < 0)
if (istart < 0) {
ilength += istart;
istart = 0;
}
try {
istart = value.offsetByCodePoints(0, istart);