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